autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Bug]: Unsupported field `name` in tool response

Open davorrunje opened this issue 2 years ago • 1 comments

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

davorrunje avatar Jan 15 '24 08:01 davorrunje

@yenif Can you take a look at this? I think it is an easy fix to remove line 916 in conversable_agent.py.

yiranwu0 avatar Jan 15 '24 16:01 yiranwu0