A programming framework for agentic AI
version update (#2908)
Chi Wang2d6c8c012bfd
diff --git a/OAI_CONFIG_LIST_sample b/OAI_CONFIG_LIST_sampleindex 9fc0dc803..aa0b39216 100644--- a/OAI_CONFIG_LIST_sample+++ b/OAI_CONFIG_LIST_sample@@ -13,13 +13,13 @@"api_key": "<your Azure OpenAI API key here>","base_url": "<your Azure OpenAI API base here>","api_type": "azure",- "api_version": "2024-02-15-preview"+ "api_version": "2024-02-01"},{"model": "<your Azure OpenAI deployment name>","api_key": "<your Azure OpenAI API key here>","base_url": "<your Azure OpenAI API base here>","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.pyindex 4c1da7a39..f1a9c2fbf 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 APIErrordiff --git a/autogen/oai/completion.py b/autogen/oai/completion.pyindex e3b01ee4d..5a62cde33 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.pyindex a676e9643..0c8a0a413 100644--- a/autogen/oai/openai_utils.py+++ b/autogen/oai/openai_utils.py@@ -14,7 +14,7 @@ from openai.types.beta.assistant import Assistantfrom packaging.version import parseNON_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 keysapi_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 dictionariesconfig_list = get_config_list(api_keys, base_urls, api_type, api_version)diff --git a/autogen/version.py b/autogen/version.pyindex 968391a2d..4f6b515ec 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.ipynbindex 8a234ede0..afa00fb75 100644--- a/notebook/agentchat_MathChat.ipynb+++ b/notebook/agentchat_MathChat.ipynb@@ -84,14 +84,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 7feb7a908..fecc98f32 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\": \"<your Azure OpenAI API base>\", \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\": \"<your Azure OpenAI API key>\",\n"," \"tags\": [\"gpt-3.5-turbo\", \"0613\"],\n"," }\n",diff --git a/notebook/agentchat_custom_model.ipynb b/notebook/agentchat_custom_model.ipynbindex b06d2c3cf..5097713a0 100644--- a/notebook/agentchat_custom_model.ipynb+++ b/notebook/agentchat_custom_model.ipynb@@ -226,14 +226,14 @@" \"api_key\": \"<your Azure OpenAI API key here>\",\n"," \"base_url\": \"<your Azure OpenAI API base here>\",\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\": \"<your Azure OpenAI API key here>\",\n"," \"base_url\": \"<your Azure OpenAI API base here>\",\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.ipynbindex 258b49d69..e07578016 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.ipynbindex c91699d0d..2a173c8e2 100644--- a/notebook/agentchat_function_call.ipynb+++ b/notebook/agentchat_function_call.ipynb@@ -90,7 +90,7 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex a7a5a92bb..d6ce5a887 100644--- a/notebook/agentchat_function_call_currency_calculator.ipynb+++ b/notebook/agentchat_function_call_currency_calculator.ipynb@@ -90,7 +90,7 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 75078e67c..000d788d6 100644--- a/notebook/agentchat_human_feedback.ipynb+++ b/notebook/agentchat_human_feedback.ipynb@@ -90,14 +90,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 55793e0ab..58e7ddd20 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.ipynbindex 508792f01..14b393958 100644--- a/notebook/agentchat_planning.ipynb+++ b/notebook/agentchat_planning.ipynb@@ -93,14 +93,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 8cb899d2b..8127cdfba 100644--- a/notebook/agentchat_stream.ipynb+++ b/notebook/agentchat_stream.ipynb@@ -90,14 +90,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 9bd69c9d5..3753be414 100644--- a/notebook/agentchat_teachable_oai_assistants.ipynb+++ b/notebook/agentchat_teachable_oai_assistants.ipynb@@ -112,14 +112,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 217492786..eb9e0c1fb 100644--- a/notebook/agentchat_two_users.ipynb+++ b/notebook/agentchat_two_users.ipynb@@ -70,14 +70,14 @@" \"api_key\": \"<your Azure OpenAI API key here>\",\n"," \"base_url\": \"<your Azure OpenAI API base here>\",\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\": \"<your Azure OpenAI API key here>\",\n"," \"base_url\": \"<your Azure OpenAI API base here>\",\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.ipynbindex 31ac248ec..f990c128b 100644--- a/notebook/agentchat_web_info.ipynb+++ b/notebook/agentchat_web_info.ipynb@@ -104,14 +104,14 @@" 'api_key': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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': '<your Azure OpenAI API key here>',\n"," 'base_url': '<your Azure OpenAI API base here>',\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.ipynbindex 34b5e5357..280b7145e 100644--- a/notebook/oai_chatgpt_gpt4.ipynb+++ b/notebook/oai_chatgpt_gpt4.ipynb@@ -131,13 +131,13 @@" 'api_key': '<your first Azure OpenAI API key here>',\n"," 'base_url': '<your first Azure OpenAI API base here>',\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': '<your second Azure OpenAI API key here>',\n"," 'base_url': '<your second Azure OpenAI API base here>',\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.ipynbindex 514ba6a4e..ac1b3f9c9 100644--- a/notebook/oai_completion.ipynb+++ b/notebook/oai_completion.ipynb@@ -97,13 +97,13 @@"# 'api_key': '<your first Azure OpenAI API key here>',\n","# 'base_url': '<your first Azure OpenAI API base here>',\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': '<your second Azure OpenAI API key here>',\n","# 'base_url': '<your second Azure OpenAI API base here>',\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': '<your first Azure OpenAI API key here>',\n","# 'base_url': '<your first Azure OpenAI API base here>',\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': '<your second Azure OpenAI API key here>',\n","# 'base_url': '<your second Azure OpenAI API base here>',\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.pyindex f2e453d92..fe75d1353 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.pyindex d5ad84d83..99f8d8d24 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.pyindex c6f7a182c..bd9a74d3f 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.mdxindex 49151f7b3..4d893b144 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": "<azure_api_key>","base_url": "<azure api 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.mdindex e97b67fa9..14723391e 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.ipynbindex c0a1b7e74..f6f383cd8 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",