[Documentation] Update tools.ipynb: use system messages in the tool_agent_caller_loop session (#5068)

* Update tools.ipynb: concat system messages in the tool_agent_caller_loop session

* Fix type mismatch on list concatenation

---------

Co-authored-by: Eric Zhu <ekzhu@users.noreply.github.com>
This commit is contained in:
zysoong 2025-01-17 02:48:55 +01:00 committed by GitHub
parent 8bd65c672f
commit 1f22a7b7a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,7 +182,7 @@
" @message_handler\n",
" async def handle_user_message(self, message: Message, ctx: MessageContext) -> Message:\n",
" # Create a session of messages.\n",
" session: List[LLMMessage] = [UserMessage(content=message.content, source=\"user\")]\n",
" session: List[LLMMessage] = self._system_messages + [UserMessage(content=message.content, source=\"user\")]\n",
" # Run the caller loop to handle tool calls.\n",
" messages = await tool_agent_caller_loop(\n",
" self,\n",