Skip to content

Python: Update workflow orchestration samples to use AzureOpenAIResponsesClient#4285

Merged
moonbox3 merged 4 commits intomicrosoft:mainfrom
moonbox3:adjust-workflow-samples-to-responses-client
Feb 26, 2026
Merged

Python: Update workflow orchestration samples to use AzureOpenAIResponsesClient#4285
moonbox3 merged 4 commits intomicrosoft:mainfrom
moonbox3:adjust-workflow-samples-to-responses-client

Conversation

@moonbox3
Copy link
Contributor

@moonbox3 moonbox3 commented Feb 26, 2026

Motivation and Context

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@moonbox3 moonbox3 self-assigned this Feb 26, 2026
Copilot AI review requested due to automatic review settings February 26, 2026 02:12
@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Feb 26, 2026
@moonbox3 moonbox3 moved this to In Review in Agent Framework Feb 26, 2026
@moonbox3 moonbox3 added the samples Issue relates to the samples label Feb 26, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request restores the use of AzureOpenAIResponsesClient across 13 orchestration samples and 1 declarative sample that were previously reverted to use AzureOpenAIChatClient/OpenAIChatClient by PR #4092. The changes align these samples with the recommended client for orchestration patterns that create agents locally without requiring server-side lifecycle management.

Changes:

  • Updated all affected samples to use AzureOpenAIResponsesClient with project_endpoint and deployment_name parameters
  • Added comprehensive README sections explaining why orchestrations use AzureOpenAIResponsesClient over the CRUD-style AzureAIAgent client
  • Fixed a private import issue in magentic_checkpoint.py (changed from azure.identity._credentials to azure.identity)

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/samples/03-workflows/orchestrations/sequential_custom_executors.py Restored AzureOpenAIResponsesClient with project_endpoint initialization
python/samples/03-workflows/orchestrations/sequential_agents.py Restored AzureOpenAIResponsesClient with project_endpoint initialization
python/samples/03-workflows/orchestrations/magentic_human_plan_review.py Restored AzureOpenAIResponsesClient, removed OpenAIChatClient usage
python/samples/03-workflows/orchestrations/magentic_checkpoint.py Restored AzureOpenAIResponsesClient, fixed private import from azure.identity._credentials
python/samples/03-workflows/orchestrations/magentic.py Restored AzureOpenAIResponsesClient, removed OpenAIChatClient and OpenAIResponsesClient usage
python/samples/03-workflows/orchestrations/handoff_simple.py Restored AzureOpenAIResponsesClient with updated type annotations and docstrings
python/samples/03-workflows/orchestrations/handoff_autonomous.py Restored AzureOpenAIResponsesClient with updated type annotations
python/samples/03-workflows/orchestrations/group_chat_simple_selector.py Restored AzureOpenAIResponsesClient with project_endpoint initialization
python/samples/03-workflows/orchestrations/group_chat_philosophical_debate.py Restored AzureOpenAIResponsesClient in helper function
python/samples/03-workflows/orchestrations/group_chat_agent_manager.py Restored AzureOpenAIResponsesClient with project_endpoint initialization
python/samples/03-workflows/orchestrations/concurrent_custom_aggregator.py Restored AzureOpenAIResponsesClient, updated docstring references
python/samples/03-workflows/orchestrations/concurrent_custom_agent_executors.py Restored AzureOpenAIResponsesClient with updated type annotations and docstrings
python/samples/03-workflows/orchestrations/concurrent_agents.py Restored AzureOpenAIResponsesClient, updated code comments
python/samples/03-workflows/orchestrations/README.md Added "Why AzureOpenAIResponsesClient?" section explaining the choice and environment variables
python/samples/03-workflows/declarative/function_tools/README.md Updated code example to use AzureOpenAIResponsesClient
python/samples/03-workflows/declarative/agent_to_function_tool/main.py Restored AzureOpenAIResponsesClient with project_endpoint initialization
python/samples/03-workflows/README.md Added "AzureOpenAIResponsesClient vs AzureAIAgent" section with detailed comparison

@moonbox3 moonbox3 enabled auto-merge February 26, 2026 04:30
@moonbox3 moonbox3 added this pull request to the merge queue Feb 26, 2026
Merged via the queue into microsoft:main with commit 8e2cc4b Feb 26, 2026
29 of 31 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Agent Framework Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python samples Issue relates to the samples

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants