mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Add warnings for deprecated azure oai config changes (#4317)
* Add warnings for deprecated azure oai config changes * Update docs and usages, simplify capabilities
This commit is contained in:
@@ -137,16 +137,12 @@
|
||||
"token_provider = get_bearer_token_provider(DefaultAzureCredential(), \"https://cognitiveservices.azure.com/.default\")\n",
|
||||
"\n",
|
||||
"az_model_client = AzureOpenAIChatCompletionClient(\n",
|
||||
" model=\"{your-azure-deployment}\",\n",
|
||||
" azure_deployment=\"{your-azure-deployment}\",\n",
|
||||
" model=\"{model-name, such as gpt-4o}\",\n",
|
||||
" api_version=\"2024-06-01\",\n",
|
||||
" azure_endpoint=\"https://{your-custom-endpoint}.openai.azure.com/\",\n",
|
||||
" azure_ad_token_provider=token_provider, # Optional if you choose key-based authentication.\n",
|
||||
" # api_key=\"sk-...\", # For key-based authentication.\n",
|
||||
" model_capabilities={\n",
|
||||
" \"vision\": True,\n",
|
||||
" \"function_calling\": True,\n",
|
||||
" \"json_output\": True,\n",
|
||||
" },\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -24,15 +24,11 @@ token_provider = get_bearer_token_provider(
|
||||
)
|
||||
|
||||
client = AzureOpenAIChatCompletionClient(
|
||||
model="{your-azure-deployment}",
|
||||
azure_deployment="{your-azure-deployment}",
|
||||
model="{model-name, such as gpt-4o}",
|
||||
api_version="2024-02-01",
|
||||
azure_endpoint="https://{your-custom-endpoint}.openai.azure.com/",
|
||||
azure_ad_token_provider=token_provider,
|
||||
model_capabilities={
|
||||
"vision":True,
|
||||
"function_calling":True,
|
||||
"json_output":True,
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -79,15 +79,11 @@
|
||||
"\n",
|
||||
"# Create the client with type-checked environment variables\n",
|
||||
"client = AzureOpenAIChatCompletionClient(\n",
|
||||
" model=get_env_variable(\"AZURE_OPENAI_DEPLOYMENT_NAME\"),\n",
|
||||
" azure_deployment=get_env_variable(\"AZURE_OPENAI_DEPLOYMENT_NAME\"),\n",
|
||||
" model=get_env_variable(\"AZURE_OPENAI_MODEL\"),\n",
|
||||
" api_version=get_env_variable(\"AZURE_OPENAI_API_VERSION\"),\n",
|
||||
" azure_endpoint=get_env_variable(\"AZURE_OPENAI_ENDPOINT\"),\n",
|
||||
" api_key=get_env_variable(\"AZURE_OPENAI_API_KEY\"),\n",
|
||||
" model_capabilities={\n",
|
||||
" \"vision\": False,\n",
|
||||
" \"function_calling\": True,\n",
|
||||
" \"json_output\": True,\n",
|
||||
" },\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -294,16 +294,12 @@
|
||||
"token_provider = get_bearer_token_provider(DefaultAzureCredential(), \"https://cognitiveservices.azure.com/.default\")\n",
|
||||
"\n",
|
||||
"az_model_client = AzureOpenAIChatCompletionClient(\n",
|
||||
" model=\"{your-azure-deployment}\",\n",
|
||||
" azure_deployment=\"{your-azure-deployment}\",\n",
|
||||
" model=\"{model-name, such as gpt-4o}\",\n",
|
||||
" api_version=\"2024-06-01\",\n",
|
||||
" azure_endpoint=\"https://{your-custom-endpoint}.openai.azure.com/\",\n",
|
||||
" azure_ad_token_provider=token_provider, # Optional if you choose key-based authentication.\n",
|
||||
" # api_key=\"sk-...\", # For key-based authentication.\n",
|
||||
" model_capabilities={\n",
|
||||
" \"vision\": True,\n",
|
||||
" \"function_calling\": True,\n",
|
||||
" \"json_output\": True,\n",
|
||||
" },\n",
|
||||
")"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user