autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Feature Request]: Add support and tests for both function calling and tools calling

Open davorrunje opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

OpenAI is deprecating function calling, but other models still use old OpenAI-compatible API and it is expected that will stay that way for some time.

Describe the solution you'd like

We could add an option in the function decorator register_for_llm, with the default value generating tools calling requests and an option to support old-style function calling requests:

@agent.register_for_llm(api_style="function_calling")
def f(a: int):
  ...

Apart from decorators, we would need to make sure we support both styles everywhere else.

Additional context

No response

davorrunje avatar Jan 11 '24 07:01 davorrunje

I wonder if we can detect the underlying model being used and just do the dirty work for the users. Like, have a dictionary somewhere with the correct syntax for each model name.

ekzhu avatar Jan 11 '24 09:01 ekzhu