diff --git a/autogen/agentchat/conversable_agent.py b/autogen/agentchat/conversable_agent.py index 0a94905ffa8..9312751aef1 100644 --- a/autogen/agentchat/conversable_agent.py +++ b/autogen/agentchat/conversable_agent.py @@ -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. @@ -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` to `"function"` if `"tool"` doesn't work: ``` @agent2.register_for_llm(api_style="function") diff --git a/test/agentchat/test_tool_calls.py b/test/agentchat/test_tool_calls.py index 4f4e822eaca..753fb326eb3 100644 --- a/test/agentchat/test_tool_calls.py +++ b/test/agentchat/test_tool_calls.py @@ -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 = [ {