From 54e6076a9d351cbf3759adbbfb5f6b8334e1582c Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Fri, 22 Mar 2024 09:15:45 +0000 Subject: [PATCH] Fix view --- src/cogs/ollama.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 3d0b767..bdd9c98 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -241,7 +241,7 @@ class PromptSelector(discord.ui.View): self.system_prompt = modal.value @discord.ui.button(label="Set System Prompt", style=discord.ButtonStyle.primary, custom_id="usr") - async def set_system_prompt(self, btn: discord.ui.Button, interaction: Interaction): + async def set_user_prompt(self, btn: discord.ui.Button, interaction: Interaction): modal = OllamaGetPrompt(self.ctx) await interaction.response.send_modal(modal) await modal.wait() @@ -344,6 +344,7 @@ class Ollama(commands.Cog): ) ] ): + system_query = None if context is not None: if not self.history.get_thread(context): await ctx.respond("Invalid context key.") @@ -359,6 +360,7 @@ class Ollama(commands.Cog): await ctx.respond("Select edit your prompts, as desired. Click done when you want to continue.", view=v) await v.wait() query = v.user_prompt or query + system_query = v.system_prompt model = model.casefold() try: