Skip to content

Commit

Permalink
fix append_oai_message
Browse files Browse the repository at this point in the history
  • Loading branch information
yiranwu0 committed Sep 29, 2023
1 parent 5550803 commit ca09533
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ def _append_oai_message(self, message: Union[Dict, str], role, conversation_id:
return False

oai_message["role"] = "function" if message.get("role") == "function" else role
if "function_call" in oai_message:
oai_message["role"] = "assistant" # only messages with role 'assistant' can have a function call.
self._oai_messages[conversation_id].append(oai_message)
return True

Expand Down

0 comments on commit ca09533

Please sign in to comment.