autogen
autogen copied to clipboard
[Bug]: Unsupported field `name` in tool response
Describe the bug
The message generated a user proxy after tool execution contains the field "name", but it should not according to the OpenAPI specs (https://github.com/openai/openai-openapi/blob/f4a2833d00e92c4b1cb531d437da88a03de997d8/openapi.yaml#L5478C5-L5495):
ChatCompletionRequestToolMessage:
type: object
title: Tool message
properties:
role:
type: string
enum: ["tool"]
description: The role of the messages author, in this case `tool`.
content:
type: string
description: The contents of the tool message.
tool_call_id:
type: string
description: Tool call that this message is responding to.
required:
- role
- content
- tool_call_id
Example of the output of user proxy after execution:
{
ātool_call_idā: ācall_1YWzmz9ADEH5aHeSyjBuvO5kā,
āroleā: ātoolā,
ānameā: ācurrency_calculatorā,
ācontentā: ā{ācurrencyā: āUSDā, āamountā: 123.45300000000002}ā
}
This causes problems with open-source LLMs (see e.g.https://levelup.gitconnected.com/do-you-know-function-calling-is-also-available-for-open-source-llms-in-autogen-b1d920f48b9b)
Steps to reproduce
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
No response
@yenif Can you take a look at this? I think it is an easy fix to remove line 916 in conversable_agent.py.