Python: [Breaking] Upgrade to azure-ai-projects 2.0+#4536
Open
eavanvalkenburg wants to merge 7 commits intomicrosoft:mainfrom
Open
Python: [Breaking] Upgrade to azure-ai-projects 2.0+#4536eavanvalkenburg wants to merge 7 commits intomicrosoft:mainfrom
eavanvalkenburg wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Add allow_preview support for internal AIProjectClient creation, keep backward compatibility for renamed SDK model classes, and align Azure AI/core paths and tests for GA validation workflows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Python Azure AI integration to require azure-ai-projects GA (2.0+) and removes/updates code paths that existed only for pre-2.0 SDK compatibility, aligning core + Azure AI package code and samples with the v2 API surface.
Changes:
- Bump
azure-ai-projectsdependency constraint to>=2.0.0,<3.0(and refresh the lockfile to GA). - Update Azure AI client/provider code to support
allow_previewon internally-createdAIProjectClientand gate preview-only agent creation behavior accordingly. - Remove/replace pre-2.0 model/tool types (e.g., Code Interpreter and text response format types) and adjust tests/samples.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| python/uv.lock | Moves azure-ai-projects to 2.0.0 GA and updates resolved dependency set. |
| python/samples/02-agents/providers/azure_ai/README.md | Documents allow_preview=True requirement for preview-only agent creation on GA SDKs. |
| python/packages/core/tests/workflow/test_function_executor.py | Suppresses pyright deprecation diagnostics for asyncio.iscoroutinefunction in tests. |
| python/packages/core/pyproject.toml | Updates core dependency constraint for azure-ai-projects to >=2.0.0,<3.0. |
| python/packages/core/agent_framework/azure/_responses_client.py | Adds allow_preview plumbing when auto-creating AIProjectClient from a Foundry project endpoint. |
| python/packages/azure-ai/tests/test_azure_ai_client.py | Updates Code Interpreter tool construction to 2.0+ AutoCodeInterpreterToolParam. |
| python/packages/azure-ai/agent_framework_azure_ai/_shared.py | Switches to 2.0+ text response format model types and simplifies return typing. |
| python/packages/azure-ai/agent_framework_azure_ai/_project_provider.py | Adds allow_preview support and preview feature gating for agent version creation. |
| python/packages/azure-ai/agent_framework_azure_ai/_client.py | Adds allow_preview support and preview feature gating for agent creation in the client flow. |
Assume azure-ai-projects 2.0+ in Azure AI client/provider/responses code paths by removing _supports_keyword_argument gating and related fallback branching. Also fix pyright typing in FoundryMemoryProvider memory store calls by using ResponseInputItemParam-typed items. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop foundry_features from Azure AI client and provider surfaces because azure-ai-projects 2.0.0 does not expose that create_version parameter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Propagate allow_preview when FoundryMemoryProvider constructs an AIProjectClient and update tests accordingly. Also finish wiring allow_preview through AzureAIClient-facing surfaces and related docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 change completes the Python move to the
azure-ai-projects2.0 GA surface. It replaces the prior beta dependency pin and removes compatibility behavior that no longer matches the supported SDK baseline, while keeping preview opt-in available through theallow_previewflag supported by the 2.0 client.Description
azure-ai-projectsto>=2.0.0,<3.0and refreshuv.lock.foundry_featurespassthrough from Azure AI agent creation, since the 2.0create_versionAPI does not expose that parameter.allow_previewthrough the Azure AI client, responses client, and Foundry memory provider creation paths.python/AGENTS.mdfor PR descriptions to follow the repository template.Contribution Checklist