mirror of
https://github.com/microsoft/autogen.git
synced 2026-01-25 14:08:00 -05:00
Correcting tool calling with Cohere (#3271)
* Update cohere.py Key in the directory should be 'message' and not 'content' as it checks for message empty at a later point in code. * Update cohere.py Added required comments to the changes made in previous commit.
This commit is contained in:
@@ -415,8 +415,9 @@ def oai_messages_to_cohere_messages(
|
||||
|
||||
# If we're adding tool_results, like we are, the last message can't be a USER message
|
||||
# So, we add a CHATBOT 'continue' message, if so.
|
||||
# Changed key from "content" to "message" (jaygdesai/autogen_Jay)
|
||||
if cohere_messages[-1]["role"] == "USER":
|
||||
cohere_messages.append({"role": "CHATBOT", "content": "Please continue."})
|
||||
cohere_messages.append({"role": "CHATBOT", "message": "Please continue."})
|
||||
|
||||
# We return a blank message when we have tool results
|
||||
# TODO: Check what happens if tool_results aren't the latest message
|
||||
|
||||
Reference in New Issue
Block a user