From 2d6c8c012bfd206998ffd76e470b9db4d2ed2a5b Mon Sep 17 00:00:00 2001 From: Chi Wang Date: Mon, 10 Jun 2024 11:23:51 -0700 Subject: [PATCH] version update (#2908) * version update * version update --- OAI_CONFIG_LIST_sample | 4 ++-- autogen/oai/client.py | 4 ++-- autogen/oai/completion.py | 2 +- autogen/oai/openai_utils.py | 4 ++-- autogen/version.py | 2 +- notebook/agentchat_MathChat.ipynb | 4 ++-- notebook/agentchat_cost_token_tracking.ipynb | 2 +- notebook/agentchat_custom_model.ipynb | 4 ++-- notebook/agentchat_dalle_and_gpt4v.ipynb | 2 +- notebook/agentchat_function_call.ipynb | 4 ++-- .../agentchat_function_call_currency_calculator.ipynb | 4 ++-- notebook/agentchat_human_feedback.ipynb | 4 ++-- notebook/agentchat_microsoft_fabric.ipynb | 2 +- notebook/agentchat_planning.ipynb | 4 ++-- notebook/agentchat_stream.ipynb | 4 ++-- notebook/agentchat_teachable_oai_assistants.ipynb | 4 ++-- notebook/agentchat_two_users.ipynb | 4 ++-- notebook/agentchat_web_info.ipynb | 4 ++-- notebook/oai_chatgpt_gpt4.ipynb | 4 ++-- notebook/oai_completion.ipynb | 8 ++++---- samples/apps/websockets/application.py | 2 +- test/oai/test_utils.py | 4 ++-- test/test_logging.py | 2 +- website/blog/2023-12-01-AutoGenStudio/index.mdx | 2 +- website/docs/Use-Cases/enhanced_inference.md | 2 +- website/docs/topics/llm_configuration.ipynb | 4 ++-- 26 files changed, 45 insertions(+), 45 deletions(-) diff --git a/OAI_CONFIG_LIST_sample b/OAI_CONFIG_LIST_sample index 9fc0dc803a..aa0b392162 100644 --- a/OAI_CONFIG_LIST_sample +++ b/OAI_CONFIG_LIST_sample @@ -13,13 +13,13 @@ "api_key": "", "base_url": "", "api_type": "azure", - "api_version": "2024-02-15-preview" + "api_version": "2024-02-01" }, { "model": "", "api_key": "", "base_url": "", "api_type": "azure", - "api_version": "2024-02-15-preview" + "api_version": "2024-02-01" } ] diff --git a/autogen/oai/client.py b/autogen/oai/client.py index 4c1da7a393..f1a9c2fbf2 100644 --- a/autogen/oai/client.py +++ b/autogen/oai/client.py @@ -349,7 +349,7 @@ class OpenAIWrapper: "api_key": os.environ.get("AZURE_OPENAI_API_KEY"), "api_type": "azure", "base_url": os.environ.get("AZURE_OPENAI_API_BASE"), - "api_version": "2024-02-15-preview", + "api_version": "2024-02-01", }, { "model": "gpt-3.5-turbo", @@ -559,7 +559,7 @@ class OpenAIWrapper: ``` - allow_format_str_template (bool | None): Whether to allow format string template in the config. Default to false. - - api_version (str | None): The api version. Default to None. E.g., "2024-02-15-preview". + - api_version (str | None): The api version. Default to None. E.g., "2024-02-01". Raises: - RuntimeError: If all declared custom model clients are not registered - APIError: If any model client create call raises an APIError diff --git a/autogen/oai/completion.py b/autogen/oai/completion.py index e3b01ee4dd..5a62cde33d 100644 --- a/autogen/oai/completion.py +++ b/autogen/oai/completion.py @@ -741,7 +741,7 @@ class Completion(openai_Completion): "api_key": os.environ.get("AZURE_OPENAI_API_KEY"), "api_type": "azure", "base_url": os.environ.get("AZURE_OPENAI_API_BASE"), - "api_version": "2024-02-15-preview", + "api_version": "2024-02-01", }, { "model": "gpt-3.5-turbo", diff --git a/autogen/oai/openai_utils.py b/autogen/oai/openai_utils.py index a676e96439..0c8a0a4133 100644 --- a/autogen/oai/openai_utils.py +++ b/autogen/oai/openai_utils.py @@ -14,7 +14,7 @@ from openai.types.beta.assistant import Assistant from packaging.version import parse NON_CACHE_KEY = ["api_key", "base_url", "api_type", "api_version", "azure_ad_token", "azure_ad_token_provider"] -DEFAULT_AZURE_API_VERSION = "2024-02-15-preview" +DEFAULT_AZURE_API_VERSION = "2024-02-01" OAI_PRICE1K = { # https://openai.com/api/pricing/ # gpt-4o @@ -127,7 +127,7 @@ def get_config_list( # Optionally, define the API type and version if they are common for all keys api_type = 'azure' - api_version = '2024-02-15-preview' + api_version = '2024-02-01' # Call the get_config_list function to get a list of configuration dictionaries config_list = get_config_list(api_keys, base_urls, api_type, api_version) diff --git a/autogen/version.py b/autogen/version.py index 968391a2db..4f6b515ecb 100644 --- a/autogen/version.py +++ b/autogen/version.py @@ -1 +1 @@ -__version__ = "0.2.28" +__version__ = "0.2.29" diff --git a/notebook/agentchat_MathChat.ipynb b/notebook/agentchat_MathChat.ipynb index 8a234ede01..afa00fb756 100644 --- a/notebook/agentchat_MathChat.ipynb +++ b/notebook/agentchat_MathChat.ipynb @@ -84,14 +84,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", " {\n", " 'model': 'gpt-3.5-turbo',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", "]\n", "```\n", diff --git a/notebook/agentchat_cost_token_tracking.ipynb b/notebook/agentchat_cost_token_tracking.ipynb index 7feb7a908f..fecc98f327 100644 --- a/notebook/agentchat_cost_token_tracking.ipynb +++ b/notebook/agentchat_cost_token_tracking.ipynb @@ -88,7 +88,7 @@ " \"model\": \"gpt-35-turbo-0613\", # 0613 or newer is needed to use functions\n", " \"base_url\": \"\", \n", " \"api_type\": \"azure\", \n", - " \"api_version\": \"2024-02-15-preview\", # 2023-07-01-preview or newer is needed to use functions\n", + " \"api_version\": \"2024-02-01\", # 2023-07-01-preview or newer is needed to use functions\n", " \"api_key\": \"\",\n", " \"tags\": [\"gpt-3.5-turbo\", \"0613\"],\n", " }\n", diff --git a/notebook/agentchat_custom_model.ipynb b/notebook/agentchat_custom_model.ipynb index b06d2c3cf4..5097713a09 100644 --- a/notebook/agentchat_custom_model.ipynb +++ b/notebook/agentchat_custom_model.ipynb @@ -226,14 +226,14 @@ " \"api_key\": \"\",\n", " \"base_url\": \"\",\n", " \"api_type\": \"azure\",\n", - " \"api_version\": \"2024-02-15-preview\"\n", + " \"api_version\": \"2024-02-01\"\n", " },\n", " {\n", " \"model\": \"gpt-4-32k\",\n", " \"api_key\": \"\",\n", " \"base_url\": \"\",\n", " \"api_type\": \"azure\",\n", - " \"api_version\": \"2024-02-15-preview\"\n", + " \"api_version\": \"2024-02-01\"\n", " }\n", "]\n", "```\n", diff --git a/notebook/agentchat_dalle_and_gpt4v.ipynb b/notebook/agentchat_dalle_and_gpt4v.ipynb index 258b49d697..e07578016a 100644 --- a/notebook/agentchat_dalle_and_gpt4v.ipynb +++ b/notebook/agentchat_dalle_and_gpt4v.ipynb @@ -93,7 +93,7 @@ " {\n", " 'model': 'dalle',\n", " 'api_key': 'Your API Key here',\n", - " 'api_version': '2024-02-15-preview'\n", + " 'api_version': '2024-02-01'\n", " }\n", "]\n", " ```" diff --git a/notebook/agentchat_function_call.ipynb b/notebook/agentchat_function_call.ipynb index c91699d0d4..2a173c8e26 100644 --- a/notebook/agentchat_function_call.ipynb +++ b/notebook/agentchat_function_call.ipynb @@ -90,7 +90,7 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01\n", " 'tags': ['tool', 'gpt-3.5-turbo'],\n", " },\n", " {\n", @@ -98,7 +98,7 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01\n", " 'tags': ['tool', 'gpt-3.5-turbo-16k'],\n", " },\n", "]\n", diff --git a/notebook/agentchat_function_call_currency_calculator.ipynb b/notebook/agentchat_function_call_currency_calculator.ipynb index a7a5a92bbd..d6ce5a8876 100644 --- a/notebook/agentchat_function_call_currency_calculator.ipynb +++ b/notebook/agentchat_function_call_currency_calculator.ipynb @@ -90,7 +90,7 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " 'tags': ['tool', '3.5-tool'],\n", " },\n", " {\n", @@ -98,7 +98,7 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " 'tags': ['tool', '3.5-tool'],\n", " },\n", "]\n", diff --git a/notebook/agentchat_human_feedback.ipynb b/notebook/agentchat_human_feedback.ipynb index 75078e67cf..000d788d6a 100644 --- a/notebook/agentchat_human_feedback.ipynb +++ b/notebook/agentchat_human_feedback.ipynb @@ -90,14 +90,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", " {\n", " 'model': 'gpt-3.5-turbo-16k',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", "]\n", "```\n", diff --git a/notebook/agentchat_microsoft_fabric.ipynb b/notebook/agentchat_microsoft_fabric.ipynb index 55793e0abb..58e7ddd202 100644 --- a/notebook/agentchat_microsoft_fabric.ipynb +++ b/notebook/agentchat_microsoft_fabric.ipynb @@ -578,7 +578,7 @@ " \"api_key\": access_token,\n", " \"base_url\": prebuilt_AI_base_url,\n", " \"api_type\": \"azure\",\n", - " \"api_version\": \"2024-02-15-preview\",\n", + " \"api_version\": \"2024-02-01\",\n", " },\n", "]" ] diff --git a/notebook/agentchat_planning.ipynb b/notebook/agentchat_planning.ipynb index 508792f01a..14b393958d 100644 --- a/notebook/agentchat_planning.ipynb +++ b/notebook/agentchat_planning.ipynb @@ -93,14 +93,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " }, # Azure OpenAI API endpoint for gpt-4\n", " {\n", " 'model': 'gpt-4-32k',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " }, # Azure OpenAI API endpoint for gpt-4-32k\n", "]\n", "```\n", diff --git a/notebook/agentchat_stream.ipynb b/notebook/agentchat_stream.ipynb index 8cb899d2b5..8127cdfbab 100644 --- a/notebook/agentchat_stream.ipynb +++ b/notebook/agentchat_stream.ipynb @@ -90,14 +90,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", " {\n", " 'model': 'gpt-3.5-turbo-16k',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", "]\n", "```\n", diff --git a/notebook/agentchat_teachable_oai_assistants.ipynb b/notebook/agentchat_teachable_oai_assistants.ipynb index 9bd69c9d51..3753be414f 100644 --- a/notebook/agentchat_teachable_oai_assistants.ipynb +++ b/notebook/agentchat_teachable_oai_assistants.ipynb @@ -112,14 +112,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", " {\n", " 'model': 'gpt-4-32k',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", "]\n", "```\n", diff --git a/notebook/agentchat_two_users.ipynb b/notebook/agentchat_two_users.ipynb index 2174927868..eb9e0c1fbf 100644 --- a/notebook/agentchat_two_users.ipynb +++ b/notebook/agentchat_two_users.ipynb @@ -70,14 +70,14 @@ " \"api_key\": \"\",\n", " \"base_url\": \"\",\n", " \"api_type\": \"azure\",\n", - " \"api_version\": \"2024-02-15-preview\"\n", + " \"api_version\": \"2024-02-01\"\n", " },\n", " {\n", " \"model\": \"gpt-4-32k\",\n", " \"api_key\": \"\",\n", " \"base_url\": \"\",\n", " \"api_type\": \"azure\",\n", - " \"api_version\": \"2024-02-15-preview\"\n", + " \"api_version\": \"2024-02-01\"\n", " }\n", "]\n", "```\n", diff --git a/notebook/agentchat_web_info.ipynb b/notebook/agentchat_web_info.ipynb index 31ac248ec9..f990c128b7 100644 --- a/notebook/agentchat_web_info.ipynb +++ b/notebook/agentchat_web_info.ipynb @@ -104,14 +104,14 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", " {\n", " 'model': 'gpt-4-32k-0314',\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " },\n", "]\n", "```\n", diff --git a/notebook/oai_chatgpt_gpt4.ipynb b/notebook/oai_chatgpt_gpt4.ipynb index 34b5e5357f..280b7145e9 100644 --- a/notebook/oai_chatgpt_gpt4.ipynb +++ b/notebook/oai_chatgpt_gpt4.ipynb @@ -131,13 +131,13 @@ " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " }, # only if at least one Azure OpenAI API key is found\n", " {\n", " 'api_key': '',\n", " 'base_url': '',\n", " 'api_type': 'azure',\n", - " 'api_version': '2024-02-15-preview',\n", + " 'api_version': '2024-02-01',\n", " }, # only if the second Azure OpenAI API key is found\n", "]\n", "```\n", diff --git a/notebook/oai_completion.ipynb b/notebook/oai_completion.ipynb index 514ba6a4ed..ac1b3f9c95 100644 --- a/notebook/oai_completion.ipynb +++ b/notebook/oai_completion.ipynb @@ -97,13 +97,13 @@ "# 'api_key': '',\n", "# 'base_url': '',\n", "# 'api_type': 'azure',\n", - "# 'api_version': '2024-02-15-preview',\n", + "# 'api_version': '2024-02-01',\n", "# }, # Azure OpenAI API endpoint for gpt-4\n", "# {\n", "# 'api_key': '',\n", "# 'base_url': '',\n", "# 'api_type': 'azure',\n", - "# 'api_version': '2024-02-15-preview',\n", + "# 'api_version': '2024-02-01',\n", "# }, # another Azure OpenAI API endpoint for gpt-4\n", "# ]\n", "\n", @@ -131,14 +131,14 @@ "# 'api_key': '',\n", "# 'base_url': '',\n", "# 'api_type': 'azure',\n", - "# 'api_version': '2024-02-15-preview',\n", + "# 'api_version': '2024-02-01',\n", "# }, # Azure OpenAI API endpoint for gpt-3.5-turbo\n", "# {\n", "# 'model': 'gpt-35-turbo-v0301',\n", "# 'api_key': '',\n", "# 'base_url': '',\n", "# 'api_type': 'azure',\n", - "# 'api_version': '2024-02-15-preview',\n", + "# 'api_version': '2024-02-01',\n", "# }, # another Azure OpenAI API endpoint for gpt-3.5-turbo with deployment name gpt-35-turbo-v0301\n", "# ]" ] diff --git a/samples/apps/websockets/application.py b/samples/apps/websockets/application.py index f2e453d924..fe75d13533 100755 --- a/samples/apps/websockets/application.py +++ b/samples/apps/websockets/application.py @@ -35,7 +35,7 @@ def _get_config_list() -> List[Dict[str, str]]: 'api_key': '0123456789abcdef0123456789abcdef', 'base_url': 'https://my-deployment.openai.azure.com/', 'api_type': 'azure', - 'api_version': '2024-02-15-preview', + 'api_version': '2024-02-01', }, { 'model': 'gpt-4', diff --git a/test/oai/test_utils.py b/test/oai/test_utils.py index d5ad84d835..99f8d8d24e 100755 --- a/test/oai/test_utils.py +++ b/test/oai/test_utils.py @@ -58,7 +58,7 @@ JSON_SAMPLE = """ "api_key": "111113fc7e8a46419bfac511bb301111", "base_url": "https://1111.openai.azure.com", "api_type": "azure", - "api_version": "2024-02-15-preview" + "api_version": "2024-02-01" }, { "model": "gpt", @@ -83,7 +83,7 @@ FILTER_CONFIG_TEST = [ "expected": JSON_SAMPLE_DICT[2:4], }, { - "filter_dict": {"api_type": "azure", "api_version": "2024-02-15-preview"}, + "filter_dict": {"api_type": "azure", "api_version": "2024-02-01"}, "exclude": False, "expected": [JSON_SAMPLE_DICT[2]], }, diff --git a/test/test_logging.py b/test/test_logging.py index c6f7a182c5..bd9a74d3fd 100644 --- a/test/test_logging.py +++ b/test/test_logging.py @@ -202,7 +202,7 @@ def test_log_oai_client(db_connection): openai_config = { "api_key": "some_key", - "api_version": "2024-02-15-preview", + "api_version": "2024-02-01", "azure_deployment": "gpt-4", "azure_endpoint": "https://foobar.openai.azure.com/", } diff --git a/website/blog/2023-12-01-AutoGenStudio/index.mdx b/website/blog/2023-12-01-AutoGenStudio/index.mdx index 49151f7b35..4d893b144a 100644 --- a/website/blog/2023-12-01-AutoGenStudio/index.mdx +++ b/website/blog/2023-12-01-AutoGenStudio/index.mdx @@ -65,7 +65,7 @@ llm_config = LLMConfig( "api_key": "", "base_url": "", "api_type": "azure", - "api_version": "2024-02-15-preview" + "api_version": "2024-02-01" }], temperature=0, ) diff --git a/website/docs/Use-Cases/enhanced_inference.md b/website/docs/Use-Cases/enhanced_inference.md index e97b67fa9d..14723391e8 100644 --- a/website/docs/Use-Cases/enhanced_inference.md +++ b/website/docs/Use-Cases/enhanced_inference.md @@ -183,7 +183,7 @@ client = OpenAIWrapper( "api_key": os.environ.get("AZURE_OPENAI_API_KEY"), "api_type": "azure", "base_url": os.environ.get("AZURE_OPENAI_API_BASE"), - "api_version": "2024-02-15-preview", + "api_version": "2024-02-01", }, { "model": "gpt-3.5-turbo", diff --git a/website/docs/topics/llm_configuration.ipynb b/website/docs/topics/llm_configuration.ipynb index c0a1b7e74a..f6f383cd85 100644 --- a/website/docs/topics/llm_configuration.ipynb +++ b/website/docs/topics/llm_configuration.ipynb @@ -92,7 +92,7 @@ " \"api_type\": \"azure\",\n", " \"api_key\": os.environ['AZURE_OPENAI_API_KEY'],\n", " \"base_url\": \"https://ENDPOINT.openai.azure.com/\",\n", - " \"api_version\": \"2024-02-15-preview\"\n", + " \"api_version\": \"2024-02-01\"\n", " }\n", " ]\n", " ```\n", @@ -328,7 +328,7 @@ " \"api_key\": os.environ.get(\"AZURE_OPENAI_API_KEY\"),\n", " \"api_type\": \"azure\",\n", " \"base_url\": os.environ.get(\"AZURE_OPENAI_API_BASE\"),\n", - " \"api_version\": \"2024-02-15-preview\",\n", + " \"api_version\": \"2024-02-01\",\n", " },\n", " {\n", " \"model\": \"llama-7B\",\n",