Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Python samples and CI sample-validation configuration to align with newer Foundry/Agent Framework APIs and environment variable naming, aiming to get sample validation passing again.
Changes:
- Standardize workflow samples on
FOUNDRY_PROJECT_ENDPOINT/FOUNDRY_MODELand update manyFoundryChatClient(..., model=...)call sites accordingly. - Update workflow samples to use
workflow.as_agent()where appropriate instead ofAgent(client=workflow, ...). - Adjust GitHub Actions sample-validation workflow/jobs and setup steps (including enabling new provider subdirs and adding Foundry envs).
Reviewed changes
Copilot reviewed 69 out of 69 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| python/scripts/sample_validation/create_dynamic_workflow_executor.py | Increase default per-agent timeout used during dynamic sample validation. |
| python/samples/README.md | Update documented env vars to FOUNDRY_* for getting started guidance. |
| python/samples/03-workflows/visualization/concurrent_with_visualization.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/tool-approval/sequential_builder_tool_approval.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/tool-approval/group_chat_builder_tool_approval.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/tool-approval/concurrent_builder_tool_approval.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/state-management/workflow_kwargs.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/state-management/state_with_agents.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/README.md | Update listed workflow env vars to FOUNDRY_*. |
| python/samples/03-workflows/parallelism/fan_out_fan_in_edges.py | Switch model env var lookup to FOUNDRY_MODEL and adjust prerequisites text. |
| python/samples/03-workflows/orchestrations/sequential_custom_executors.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/sequential_chain_only_agent_responses.py | Replace Azure client usage with FoundryChatClient + Agent(...) construction. |
| python/samples/03-workflows/orchestrations/sequential_agents.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/magentic.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/magentic_human_plan_review.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/magentic_checkpoint.py | Switch model env var lookup to FOUNDRY_MODEL for all agents. |
| python/samples/03-workflows/orchestrations/handoff_with_tool_approval_checkpoint_resume.py | Switch model env var lookup to FOUNDRY_MODEL and adjust prerequisites text. |
| python/samples/03-workflows/orchestrations/handoff_with_code_interpreter_file.py | Switch model env var lookup to FOUNDRY_MODEL and adjust prerequisites text. |
| python/samples/03-workflows/orchestrations/handoff_simple.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/handoff_autonomous.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/orchestrations/group_chat_simple_selector.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/group_chat_philosophical_debate.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/group_chat_agent_manager.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/concurrent_custom_aggregator.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/concurrent_custom_agent_executors.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/orchestrations/concurrent_agents.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/human-in-the-loop/sequential_request_info.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/human-in-the-loop/guessing_game_with_human_input.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/human-in-the-loop/group_chat_request_info.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/human-in-the-loop/concurrent_request_info.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/human-in-the-loop/agents_with_HITL.py | Switch model env var lookup to FOUNDRY_MODEL and adjust how tool choice is provided. |
| python/samples/03-workflows/human-in-the-loop/agents_with_declaration_only_tools.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/human-in-the-loop/agents_with_approval_requests.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/declarative/student_teacher/main.py | Switch model env var lookup to FOUNDRY_MODEL and update docstring env list. |
| python/samples/03-workflows/declarative/marketing/main.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/declarative/function_tools/main.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/declarative/deep_research/main.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/declarative/customer_support/main.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/declarative/agent_to_function_tool/main.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/control-flow/switch_case_edge_group.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/control-flow/simple_loop.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/control-flow/multi_selection_edge_group.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/control-flow/edge_condition.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/composition/sub_workflow_kwargs.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/checkpoint/workflow_as_agent_checkpoint.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/checkpoint/checkpoint_with_human_in_the_loop.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/agents/workflow_as_agent_with_session.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/workflow_as_agent_reflection_pattern.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/workflow_as_agent_kwargs.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/workflow_as_agent_human_in_the_loop.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/sequential_workflow_as_agent.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/magentic_workflow_as_agent.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/handoff_workflow_as_agent.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/agents/group_chat_workflow_as_agent.py | Switch model env var lookup to FOUNDRY_MODEL. |
| python/samples/03-workflows/agents/custom_agent_executors.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/agents/concurrent_workflow_as_agent.py | Switch model env var lookup to FOUNDRY_MODEL and use workflow.as_agent(). |
| python/samples/03-workflows/agents/azure_chat_agents_tool_calls_with_feedback.py | Switch model env var lookup to FOUNDRY_MODEL and simplify full-conversation handling. |
| python/samples/03-workflows/agents/azure_chat_agents_streaming.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/agents/azure_chat_agents_and_executor.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/agents/azure_ai_agents_with_shared_session.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/agents/azure_ai_agents_streaming.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/_start-here/step3_streaming.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/03-workflows/_start-here/step2_agents_in_a_workflow.py | Switch model env var lookup to FOUNDRY_MODEL and update prerequisites text. |
| python/samples/02-agents/typed_options.py | Update provider client constructor args and use Message list inputs for get_response. |
| python/samples/02-agents/context_providers/redis/redis_conversation.py | Load .env via load_dotenv() for sample configuration. |
| python/samples/02-agents/compaction/compaction_provider.py | Update OpenAIChatClient constructor arg name to model. |
| python/samples/01-get-started/README.md | Remove outdated env-var setup snippet for getting started docs. |
| .github/workflows/python-sample-validation.yml | Update sample-validation jobs/env vars and provider job structure; add Foundry envs. |
| .github/actions/sample-validation-setup/action.yml | Add copilot --version to improve diagnostics in CI setup. |
| Workflow samples that use `AzureOpenAIResponsesClient` expect: | ||
|
|
||
| - `AZURE_AI_PROJECT_ENDPOINT` (Azure AI Foundry Agent Service (V2) project endpoint) | ||
| - `AZURE_AI_MODEL_DEPLOYMENT_NAME` (model deployment name) | ||
| - `FOUNDRY_PROJECT_ENDPOINT` (Azure AI Foundry Agent Service (V2) project endpoint) | ||
| - `FOUNDRY_MODEL` (model deployment name) |
There was a problem hiding this comment.
This section says “Workflow samples that use AzureOpenAIResponsesClient expect:” but the sample code under 03-workflows/ now uses FoundryChatClient (and there are no AzureOpenAIResponsesClient references in that folder). Please update the wording/heading to match the actual client used, otherwise the env-var guidance is confusing/misleading.
| @@ -67,11 +67,13 @@ jobs: | |||
| # Azure AI configuration | |||
| AZURE_AI_PROJECT_ENDPOINT: ${{ vars.AZURE_AI_PROJECT_ENDPOINT }} | |||
| AZURE_AI_MODEL_DEPLOYMENT_NAME: ${{ vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} | |||
There was a problem hiding this comment.
nit: are we changing this AZUREOPENAI__RESPONSESDEPLOYMENTNAME too to AZURE_OPENAI__RESPONSES_DEPLOYMENT_NAME ?
There was a problem hiding this comment.
We need to consolidate it. We have both defined for our repo.
Motivation and Context
Fix some of the samples
Contribution Checklist