From 232068a245043aa7b62b2a93beb66b572b8da1e2 Mon Sep 17 00:00:00 2001 From: Gerardo Moreno Date: Fri, 22 Nov 2024 06:05:52 -0800 Subject: [PATCH] Add system msg when calling inside the assistant tool loop (#4308) (#4309) --- .../src/autogen_agentchat/agents/_assistant_agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py index 7e502498f9b..cb1eff8d6f6 100644 --- a/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py +++ b/python/packages/autogen-agentchat/src/autogen_agentchat/agents/_assistant_agent.py @@ -279,8 +279,9 @@ async def on_messages_stream( return # Generate an inference result based on the current model context. + llm_messages = self._system_messages + self._model_context result = await self._model_client.create( - self._model_context, tools=self._tools + self._handoff_tools, cancellation_token=cancellation_token + llm_messages, tools=self._tools + self._handoff_tools, cancellation_token=cancellation_token ) self._model_context.append(AssistantMessage(content=result.content, source=self.name))