microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
31.25k stars 4.56k forks source link

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

Open davorrunje opened 8 months ago

davorrunje commented 8 months ago

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

ekzhu commented 8 months ago

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.