From 915a3f9e25292cd2025a7c85f9b435cdf4f3034e Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Tue, 19 Nov 2024 16:26:31 +0100 Subject: [PATCH] Change internal command result messages to system ones --- plugins/chat.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/chat.py b/plugins/chat.py index 8724278..aaf3228 100644 --- a/plugins/chat.py +++ b/plugins/chat.py @@ -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: @@ -385,7 +383,7 @@ 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}", @@ -393,7 +391,7 @@ async def process_tool_calls( ) 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."