autogen
autogen copied to clipboard
[Feature Request]: Add support and tests for both function calling and tools calling
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
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.