Skip to content

Commit

Permalink
Change internal command result messages to system ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Nov 19, 2024
1 parent be677f9 commit 915a3f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugins/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,7 @@ async def hey(self, ctx: commands.Context):

await self.bot.send(ctx, final_message, reply=not final_resulted_in_command_message)

async def process_tool_calls(
self, ctx, prompt_messages, citations, math_operations, iterations_left, tool_calls
):
async def process_tool_calls(self, ctx, prompt_messages, citations, math_operations, iterations_left, tool_calls):
iteration_resulted_in_command_message = False
for call in tool_calls:
if call.function.name == ASK_ONLINE_FUNCTION_DEFINITION.name:
Expand All @@ -385,15 +383,15 @@ async def process_tool_calls(

prompt_messages.append(
{
"role": "user",
"role": "system",
"content": "Komenda nie dała rezultatu w postaci wiadomości."
if not resulting_message_content
else f"Rezultat komendy to:\n{resulting_message_content}",
}
)
prompt_messages.append(
{
"role": "user",
"role": "system",
"content": "Wystarczy już komend, odpowiedz jak możesz."
if iterations_left == 1
else "Spróbuj ponownie naprawiając ten błąd."
Expand Down

0 comments on commit 915a3f9

Please sign in to comment.