Skip to content

Commit

Permalink
Update Azure OpenAI API to 2024-02-15-preview (#1692)
Browse files Browse the repository at this point in the history
On April 2, 2024 the following API preview releases will be retired and will stop accepting API requests:

2023-03-15-preview
2023-06-01-preview
2023-07-01-preview
2023-08-01-preview

To avoid service disruptions, update to use the latest version 2024-02-15-preview.

https://review.learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
  • Loading branch information
Xtrah authored Feb 15, 2024
1 parent 5ca69da commit 7ceee5d
Show file tree
Hide file tree
Showing 34 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions OAI_CONFIG_LIST_sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
"api_key": "<your Azure OpenAI API key here>",
"base_url": "<your Azure OpenAI API base here>",
"api_type": "azure",
"api_version": "2023-07-01-preview"
"api_version": "2024-02-15-preview"
},
{
"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": "2023-07-01-preview"
"api_version": "2024-02-15-preview"
}
]
4 changes: 2 additions & 2 deletions autogen/oai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def __init__(self, *, config_list: Optional[List[Dict[str, Any]]] = None, **base
"api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
"api_type": "azure",
"base_url": os.environ.get("AZURE_OPENAI_API_BASE"),
"api_version": "2023-03-15-preview",
"api_version": "2024-02-15-preview",
},
{
"model": "gpt-3.5-turbo",
Expand Down Expand Up @@ -534,7 +534,7 @@ def yes_or_no_filter(context, response):
```
- 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., "2023-08-01-preview".
- api_version (str | None): The api version. Default to None. E.g., "2024-02-15-preview".
Raises:
- RuntimeError: If all declared custom model clients are not registered
- APIError: If any model client create call raises an APIError
Expand Down
2 changes: 1 addition & 1 deletion autogen/oai/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def create(
"api_key": os.environ.get("AZURE_OPENAI_API_KEY"),
"api_type": "azure",
"base_url": os.environ.get("AZURE_OPENAI_API_BASE"),
"api_version": "2023-03-15-preview",
"api_version": "2024-02-15-preview",
},
{
"model": "gpt-3.5-turbo",
Expand Down
4 changes: 2 additions & 2 deletions autogen/oai/openai_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Assistant = object

NON_CACHE_KEY = ["api_key", "base_url", "api_type", "api_version"]
DEFAULT_AZURE_API_VERSION = "2023-12-01-preview"
DEFAULT_AZURE_API_VERSION = "2024-02-15-preview"
OAI_PRICE1K = {
"text-ada-001": 0.0004,
"text-babbage-001": 0.0005,
Expand Down Expand Up @@ -112,7 +112,7 @@ def get_config_list(
# Optionally, define the API type and version if they are common for all keys
api_type = 'azure'
api_version = '2023-12-01-preview'
api_version = '2024-02-15-preview'
# 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)
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_MathChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_agentoptimizer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
"EPOCH = 10\n",
"OAI_config = {\n",
" \"AZURE_OPENAI_API_KEY\": \"gpt-4-1106-preview\",\n",
" \"api_version\": \"2023-12-01-preview\",\n",
" \"api_version\": \"2024-02-15-preview\",\n",
" \"azure_endpoint\": \"your_azure_endpoint\",\n",
" \"model\": \"your_model\",\n",
"}\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_chess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_compression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_cost_token_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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\": \"2023-08-01-preview\", # 2023-07-01-preview or newer is needed to use functions\n",
" \"api_version\": \"2024-02-15-preview\", # 2023-07-01-preview or newer is needed to use functions\n",
" \"api_key\": \"<your Azure OpenAI API key>\"\n",
" }\n",
"]\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_custom_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,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\": \"2023-08-01-preview\"\n",
" \"api_version\": \"2024-02-15-preview\"\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\": \"2023-08-01-preview\"\n",
" \"api_version\": \"2024-02-15-preview\"\n",
" }\n",
"]\n",
"```\n",
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_dalle_and_gpt4v.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
" {\n",
" 'model': 'dalle',\n",
" 'api_key': 'Your API Key here',\n",
" 'api_version': '2023-06-01-preview'\n",
" 'api_version': '2024-02-15-preview'\n",
" }\n",
"]\n",
" ```"
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_function_call.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_function_call_currency_calculator.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_groupchat_research.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_groupchat_vis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_human_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
2 changes: 1 addition & 1 deletion notebook/agentchat_microsoft_fabric.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@
" \"api_key\": access_token,\n",
" \"base_url\": prebuilt_AI_base_url,\n",
" \"api_type\": \"azure\",\n",
" \"api_version\": \"2023-08-01-preview\",\n",
" \"api_version\": \"2024-02-15-preview\",\n",
" },\n",
"]"
]
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_planning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" }, # Azure OpenAI API endpoint for gpt-4-32k\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_qdrant_RetrieveChat.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_stream.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-08-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_teachability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_teachable_oai_assistants.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\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': '2023-06-01-preview',\n",
" 'api_version': '2024-02-15-preview',\n",
" },\n",
"]\n",
"```\n",
Expand Down
4 changes: 2 additions & 2 deletions notebook/agentchat_teaching.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,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\": \"2023-06-01-preview\"\n",
" \"api_version\": \"2024-02-15-preview\"\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\": \"2023-06-01-preview\"\n",
" \"api_version\": \"2024-02-15-preview\"\n",
" }\n",
"]\n",
"```\n",
Expand Down
Loading

0 comments on commit 7ceee5d

Please sign in to comment.