Merge remote-tracking branch 'origin/master'
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 8s
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 8s
This commit is contained in:
commit
ea39f0fe56
4 changed files with 28 additions and 6 deletions
19
.gitea/workflows/docker-publish.yaml
Normal file
19
.gitea/workflows/docker-publish.yaml
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
name: Build and Publish Jimmy.2
|
||||||
|
run-name: Build and Publish Jimmy.2
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_and_publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker build -t git.i-am.nexus/nex/college-bot:latest .
|
||||||
|
- name: Log into container registry
|
||||||
|
run: |
|
||||||
|
docker login -u ${{ secrets.CR_USERNAME }} -p ${{ secrets.CR_PASSWORD }} git.i-am.nexus
|
||||||
|
- name: Push to container registry
|
||||||
|
run: |
|
||||||
|
docker push git.i-am.nexus/nex/college-bot:latest
|
|
@ -1,7 +1,7 @@
|
||||||
services:
|
services:
|
||||||
jimmy:
|
jimmy:
|
||||||
container_name: jimmy-v2
|
container_name: jimmy-v2
|
||||||
build: .
|
image: git.i-am.nexus/nex/college-bot:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
tty: true
|
tty: true
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -9,8 +9,6 @@ services:
|
||||||
- ./jimmy.log:/app/jimmy.log
|
- ./jimmy.log:/app/jimmy.log
|
||||||
- /dev/dri:/dev/dri
|
- /dev/dri:/dev/dri
|
||||||
- jimmy-data:/app/data
|
- jimmy-data:/app/data
|
||||||
ports:
|
|
||||||
- 11444:8080
|
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- host.docker.internal:host-gateway
|
- host.docker.internal:host-gateway
|
||||||
ollama:
|
ollama:
|
||||||
|
|
|
@ -507,6 +507,8 @@ class Ollama(commands.Cog):
|
||||||
discord.Option(discord.Attachment, "An image to feed into ollama. Only works with llava.", default=None),
|
discord.Option(discord.Attachment, "An image to feed into ollama. Only works with llava.", default=None),
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
|
if not SERVER_KEYS:
|
||||||
|
return await ctx.respond("No servers available. Please try again later.")
|
||||||
system_query = None
|
system_query = None
|
||||||
if context is not None:
|
if context is not None:
|
||||||
if not self.history.get_thread(context):
|
if not self.history.get_thread(context):
|
||||||
|
@ -834,7 +836,8 @@ class Ollama(commands.Cog):
|
||||||
],
|
],
|
||||||
):
|
):
|
||||||
"""Shows the history for a thread."""
|
"""Shows the history for a thread."""
|
||||||
# await ctx.defer(ephemeral=True)
|
if not SERVER_KEYS:
|
||||||
|
return await ctx.respond("No servers available. Please try again later.")
|
||||||
paginator = commands.Paginator("", "", 4000, "\n\n")
|
paginator = commands.Paginator("", "", 4000, "\n\n")
|
||||||
|
|
||||||
thread = self.history.load_thread(thread_id)
|
thread = self.history.load_thread(thread_id)
|
||||||
|
@ -859,6 +862,8 @@ class Ollama(commands.Cog):
|
||||||
|
|
||||||
@commands.message_command(name="Ask AI")
|
@commands.message_command(name="Ask AI")
|
||||||
async def ask_ai(self, ctx: discord.ApplicationContext, message: discord.Message):
|
async def ask_ai(self, ctx: discord.ApplicationContext, message: discord.Message):
|
||||||
|
if not SERVER_KEYS:
|
||||||
|
return await ctx.respond("No servers available. Please try again later.")
|
||||||
thread = self.history.create_thread(message.author)
|
thread = self.history.create_thread(message.author)
|
||||||
content = message.clean_content
|
content = message.clean_content
|
||||||
if not content:
|
if not content:
|
||||||
|
|
|
@ -126,9 +126,9 @@ class QuoteQuota(commands.Cog):
|
||||||
filtered_messages += 1
|
filtered_messages += 1
|
||||||
continue
|
continue
|
||||||
if message.attachments:
|
if message.attachments:
|
||||||
regex = r".*\s*-\s*@?([\w\s]+)"
|
regex = r".*\s*-\s*([\w]+)"
|
||||||
else:
|
else:
|
||||||
regex = r".+\s+-\s*@?([\w\s]+)"
|
regex = r".+\s+-\s*([\w]+)"
|
||||||
|
|
||||||
if not (m := re.match(regex, str(message.clean_content))):
|
if not (m := re.match(regex, str(message.clean_content))):
|
||||||
filtered_messages += 1
|
filtered_messages += 1
|
||||||
|
|
Loading…
Reference in a new issue