Python: [BREAKING] Migrate Azure OpenAI Chat and Responses Clients to v1 GA API#3416
Draft
giles17 wants to merge 2 commits intomicrosoft:mainfrom
Draft
Python: [BREAKING] Migrate Azure OpenAI Chat and Responses Clients to v1 GA API#3416giles17 wants to merge 2 commits intomicrosoft:mainfrom
giles17 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates Azure OpenAI Chat and Responses clients from using the Azure-specific OpenAI SDK to the standard v1 GA API, eliminating the need for the api_version parameter. This is a breaking change that simplifies the API and aligns with Azure OpenAI's GA offering.
Changes:
- Removed
api_versionparameter fromAzureOpenAIChatClientandAzureOpenAIResponsesClientconstructors - Replaced
AsyncAzureOpenAIwithAsyncOpenAIclient for Chat and Responses - Added automatic v1 API path construction for standard Azure OpenAI endpoints
- Updated all samples and documentation to reflect the API changes
- Migrated authentication to use standard OpenAI client patterns
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/packages/core/agent_framework/azure/_shared.py | Core changes: Added _construct_v1_base_url helper, updated AzureOpenAIConfigMixin to use AsyncOpenAI and construct v1 API URLs automatically |
| python/packages/core/agent_framework/azure/_chat_client.py | Removed api_version parameter, updated type hints from AsyncAzureOpenAI to AsyncOpenAI, updated docstrings |
| python/packages/core/agent_framework/azure/_responses_client.py | Removed api_version parameter, updated type hints from AsyncAzureOpenAI to AsyncOpenAI, removed temporary v1 URL hack, updated docstrings |
| python/packages/core/tests/azure/test_azure_chat_client.py | Updated tests to use AsyncOpenAI instead of AsyncAzureOpenAI, removed assertions for api_version in serialization tests |
| python/packages/core/tests/azure/test_azure_responses_client.py | Added tests for _check_model_presence method |
| python/packages/core/tests/azure/conftest.py | Updated test endpoint to use standard Azure OpenAI domain pattern |
| python/samples/getting_started/agents/azure_openai/README.md | Updated documentation to clarify api_version is only for Assistants client |
| python/samples/getting_started/multimodal_input/README.md | Added note about v1 API not requiring api_version |
| python/samples/getting_started/devui/in_memory_mode.py | Updated to use new parameter names (endpoint and deployment_name instead of azure_endpoint and model_id) |
| python/samples/getting_started/devui/azure_responses_agent/agent.py | Removed api_version parameter from client initialization |
| python/samples/getting_started/agents/azure_openai/azure_responses_client_with_local_mcp.py | Updated comments to remove api_version references |
| python/samples/getting_started/agents/azure_openai/azure_responses_client_with_hosted_mcp.py | Updated to use to_function_approval_response instead of deprecated create_response method |
| python/samples/getting_started/agents/azure_openai/azure_responses_client_with_file_search.py | Updated to use Content.from_hosted_vector_store instead of HostedVectorStoreContent |
| python/samples/getting_started/agents/azure_openai/azure_responses_client_with_explicit_settings.py | Added print statement for better output clarity |
| python/samples/getting_started/agents/azure_openai/azure_responses_client_image_analysis.py | Updated to use Content.from_text and Content.from_uri factory methods, changed image URL |
| python/samples/getting_started/agents/azure_openai/azure_chat_client_with_explicit_settings.py | Added print statement for better output clarity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
This PR addresses issue #2567 by migrating
AzureOpenAIChatClientandAzureOpenAIResponsesClientto use the Azure OpenAI v1 GA API, eliminating the need forapi_versionin these clients.Note: AzureOpenAIAssistantsClient still requires api_version as Assistants API is not part of the v1 GA release.
Description
Contribution Checklist