Python: [BREAKING] Python: Provider-leading client design & OpenAI package extraction#4818
Open
eavanvalkenburg wants to merge 20 commits intomicrosoft:mainfrom
Open
Python: [BREAKING] Python: Provider-leading client design & OpenAI package extraction#4818eavanvalkenburg wants to merge 20 commits intomicrosoft:mainfrom
eavanvalkenburg wants to merge 20 commits intomicrosoft:mainfrom
Conversation
Member
ca4c3d7 to
154a180
Compare
moonbox3
reviewed
Mar 21, 2026
python/packages/azure-ai/agent_framework_azure_ai/_deprecated_azure_openai.py
Show resolved
Hide resolved
python/packages/foundry_local/agent_framework_foundry_local/_foundry_local_client.py
Show resolved
Hide resolved
moonbox3
approved these changes
Mar 21, 2026
23f1aba to
d16352c
Compare
moonbox3
approved these changes
Mar 22, 2026
giles17
reviewed
Mar 23, 2026
python/samples/02-agents/providers/azure/foundry_agent_custom_client.py
Outdated
Show resolved
Hide resolved
python/samples/02-agents/providers/azure/foundry_chat_client_basic.py
Outdated
Show resolved
Hide resolved
python/samples/02-agents/providers/azure/foundry_chat_client_basic.py
Outdated
Show resolved
Hide resolved
giles17
reviewed
Mar 23, 2026
## Summary Major refactoring of the Python Agent Framework client architecture: - Extract OpenAI clients into new `agent-framework-openai` package - Core package no longer depends on openai, azure-identity, azure-ai-projects - Rename clients for discoverability: OpenAIResponsesClient → OpenAIChatClient, OpenAIChatClient → OpenAIChatCompletionClient - Unify `model_id`/`deployment_name`/`model_deployment_name` → `model` param - New FoundryChatClient for Azure AI Foundry Responses API - New FoundryAgent/FoundryAgentClient for connecting to pre-configured Foundry agents - Remove OpenAIBase/OpenAIConfigMixin from non-deprecated client MRO - Deprecate AzureOpenAI* clients, AzureAIClient, OpenAIAssistantsClient - Reorganize samples: azure_openai+azure_ai+azure_ai_agent → azure/ - ADR-0020: Provider-Leading Client Design Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…local sample Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- azure-ai mypy: add type ignores for TypedDict total=, model arg, forward ref - Coverage: replace core.azure/openai targets with openai package target - project_provider: add type annotation for opts dict Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…gets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rs to old classes
1963c81 to
11403cd
Compare
giles17
approved these changes
Mar 23, 2026
TaoChenOSU
approved these changes
Mar 23, 2026
giles17
approved these changes
Mar 23, 2026
moonbox3
approved these changes
Mar 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
moonbox3
approved these changes
Mar 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
westey-m
approved these changes
Mar 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Make
agent-framework-corelightweight by extracting OpenAI clients into their own package, and improve discoverability by using provider-leading naming conventions. See ADR-0020 for full rationale.Description
New
agent-framework-openaipackage:OpenAIChatClient(Responses API, wasOpenAIResponsesClient)OpenAIChatCompletionClient(Chat Completions API, wasOpenAIChatClient)OpenAIEmbeddingClientCore made lighter:
openai,azure-identity,azure-ai-projects,packagingfrom core depsagent_framework.openaiandagent_framework.azureare lazy-loading gatewaysNew Foundry clients in azure-ai:
FoundryChatClient/RawFoundryChatClient— Responses API via Foundry projectFoundryAgent/RawFoundryAgent— connect to pre-configured PromptAgents/HostedAgentsRawFoundryAgentChatClient— extension point for custom client middlewareParameter unification:
model_id/deployment_name/model_deployment_name→modelOPENAI_RESPONSES_MODEL_ID/OPENAI_CHAT_MODEL_ID→OPENAI_MODELFOUNDRY_MODEL,FOUNDRY_PROJECT_ENDPOINTfor Foundry clientsClass hierarchy cleanup:
OpenAIBase/OpenAIConfigMixinremoved from non-deprecated MRO_ensure_client/_initialize_clientremoved (client set directly in Raw init)AzureOpenAI*clients,AzureAIClient,AzureAIAgentClient,OpenAIAssistantsClient_deprecated_azure_openai.pyfor clean deletionSamples:
azure_openai/+azure_ai/+azure_ai_agent/merged intoazure/FoundryAgentandFoundryChatClientsamples addedFoundryChatClientas_agent()replaced withAgent(client=...)patternAzureCliCredential, neverDefaultAzureCredentialFixes #3318
Fixes #3306 for python
Contribution Checklist