the roles in chat_history seem confused? #1839
-
Hi, I'm looking into the notebook https://github.com/microsoft/autogen/blob/main/notebook/agentchat_function_call_currency_calculator.ipynb In the last cell: I'm wondering, the the first message, "How much is 123.45 US Dollars in Euros?", is supposedly asked by the user. But in the chat_history, it showed that the role is the assistant? In the first response, the program shows this message, "How much is 123.45 USD in EUR?" was "user_proxy (to chatbot):". Did I have misunderstood the meaning of the 'role' in the chat_history? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
This is a common source of confusion. When two agents are conversing, each maintains its own copy of the message history, and their roles are reversed in those two copies. The reason for this is because openai defined a fixed set of message roles like user and assistant, and autogen follows those roles in its message lists. In a group chat it may be that none of the agents represent the user, and yet every message list sent to the LLM must be annotated with user and assistant roles. The simple rule to remember is that every agent carries the assistant role in its own copy of the message list. |
Beta Was this translation helpful? Give feedback.
This is a common source of confusion. When two agents are conversing, each maintains its own copy of the message history, and their roles are reversed in those two copies. The reason for this is because openai defined a fixed set of message roles like user and assistant, and autogen follows those roles in its message lists. In a group chat it may be that none of the agents represent the user, and yet every message list sent to the LLM must be annotated with user and assistant roles. The simple rule to remember is that every agent carries the assistant role in its own copy of the message list.