Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Update documentation for function call compatibility #1237

Merged
merged 16 commits into from
Jan 16, 2024
3 changes: 2 additions & 1 deletion autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,7 @@ def register_for_llm(
For Azure OpenAI API, use version 2023-12-01-preview or later.
`"function"` style will be deprecated. For earlier version use
`"function"` if `"tool"` doesn't work.
See [Azure OpenAI documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/function-calling?tabs=python) for details.

Returns:
The decorator for registering a function to be used by an agent.
Expand All @@ -1729,7 +1730,7 @@ def my_function(a: Annotated[str, "description of a parameter"] = "a", b: int, c
return a + str(b * c)
```

For Azure OpenAI versions 2023-10-01-preview and earlier, set `api_style`
For Azure OpenAI versions prior to 2023-12-01-preview, set `api_style`
sonichi marked this conversation as resolved.
Show resolved Hide resolved
to `"function"` if `"tool"` doesn't work:
```
@agent2.register_for_llm(api_style="function")
Expand Down
3 changes: 3 additions & 0 deletions test/agentchat/test_tool_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def test_eval_math_responses_api_style_function():
config_list = autogen.config_list_from_models(
KEY_LOC,
model_list=["gpt-4-0613", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k"],
filter_dict={
"api_type": ["azure"],
},
)
functions = [
{
Expand Down
Loading