From 9d98dbd38d93ca0ec4ecf41e49f228e8229d0132 Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Thu, 25 Jun 2026 10:46:08 -0700 Subject: [PATCH 1/3] Add skill to replace hardcoded foundry project endpoint and model --- .../create_dynamic_workflow_executor.py | 10 +++- .../skills/foundry-config-setup/SKILL.md | 53 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 python/scripts/sample_validation/skills/foundry-config-setup/SKILL.md diff --git a/python/scripts/sample_validation/create_dynamic_workflow_executor.py b/python/scripts/sample_validation/create_dynamic_workflow_executor.py index 6ebe25a8d4e..97b8524ec1e 100644 --- a/python/scripts/sample_validation/create_dynamic_workflow_executor.py +++ b/python/scripts/sample_validation/create_dynamic_workflow_executor.py @@ -3,10 +3,12 @@ import logging from collections import deque from dataclasses import dataclass +from pathlib import Path from agent_framework import ( Executor, Message, + SkillsProvider, Workflow, WorkflowBuilder, WorkflowContext, @@ -31,6 +33,9 @@ logger = logging.getLogger(__name__) +# Directory containing file-based skills used by the validation agents. +SKILLS_DIR = Path(__file__).parent / "skills" + class AgentResponseFormat(BaseModel): status: str @@ -58,7 +63,9 @@ class BatchCompletion: "Analyze the sample code and execute it as it is. Based on the execution result, determine " "if it runs successfully, fails, or is missing_setup. Use `missing_setup` if the sample reports " "missing required environment variables. The environment you're given should contain the necessary " - "variables. Don't create new environment variables nor modify the sample code.\n" + "variables. Don't create new environment variables nor modify the sample code, unless an available " + "skill instructs you to do so for the setup issue you detected. When a skill applies to the problem, " + "follow its guidance to resolve the setup and then re-run the sample.\n" "Feel free to install any required dependencies if needed.\n" "The sample can be interactive. If it is interactive, respond to the sample when prompted " "based on your analysis of the code. You do not need to consult human on what to respond.\n" @@ -289,6 +296,7 @@ async def create( id=agent_id, name=agent_id, instructions=AgentInstruction, + context_providers=[SkillsProvider.from_paths(skill_paths=str(SKILLS_DIR))], default_options={ "on_permission_request": prompt_permission, "timeout": 120, diff --git a/python/scripts/sample_validation/skills/foundry-config-setup/SKILL.md b/python/scripts/sample_validation/skills/foundry-config-setup/SKILL.md new file mode 100644 index 00000000000..b8e3a8d85b0 --- /dev/null +++ b/python/scripts/sample_validation/skills/foundry-config-setup/SKILL.md @@ -0,0 +1,53 @@ +--- +name: foundry-config-setup +description: Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded project_endpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment. +license: MIT +compatibility: Works with any model that supports tool use. +metadata: + author: agent-framework-samples + version: "1.0" +--- + +## Usage + +Some samples (notably those under `01-get-started`) hardcode the Foundry +project endpoint and model directly in the `FoundryChatClient` constructor +using placeholder values, for example: + +```python +client = FoundryChatClient( + project_endpoint="https://your-project.services.ai.azure.com", + model="gpt-4o", + credential=AzureCliCredential(), +) +``` + +These placeholder values are not real and the sample cannot run as written. +The validation environment provides the real values through environment +variables, so the sample must read them from the environment instead. + +When you detect a hardcoded/placeholder `project_endpoint` (or `model`) that +is causing the sample to fail with missing or invalid setup: + +1. Replace the hardcoded `project_endpoint` value with a read from the + `FOUNDRY_PROJECT_ENDPOINT` environment variable. +2. Replace the hardcoded `model` value with a read from the `FOUNDRY_MODEL` + environment variable. +3. Ensure `import os` is present at the top of the file. + +The corrected constructor should look like: + +```python +import os + +client = FoundryChatClient( + project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"], + model=os.environ["FOUNDRY_MODEL"], + credential=AzureCliCredential(), +) +``` + +These samples are intentionally written with hardcoded placeholders, so this +is expected setup—not a defect in the sample. After applying the change, +re-run the sample and report the result as a `success` if it now runs. Do not +include a suggested `fix`. From ae13f79542c2ae8ac64683a53f24471f9c725704 Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Thu, 25 Jun 2026 11:54:43 -0700 Subject: [PATCH 2/3] Include more samples and fix migration samples part 1 --- .../workflows/python-sample-validation.yml | 69 +++++++++---------- .../single_agent/01_basic_agent.py | 4 +- .../01_basic_chat_completion.py | 2 + .../02_chat_completion_with_tool.py | 2 + .../03_chat_completion_thread_and_stream.py | 2 + .../skills/hosting-sample-runner/SKILL.md | 50 ++++++++++++++ 6 files changed, 93 insertions(+), 36 deletions(-) create mode 100644 python/scripts/sample_validation/skills/hosting-sample-runner/SKILL.md diff --git a/.github/workflows/python-sample-validation.yml b/.github/workflows/python-sample-validation.yml index bd76eb12d23..320f9c38b11 100644 --- a/.github/workflows/python-sample-validation.yml +++ b/.github/workflows/python-sample-validation.yml @@ -23,8 +23,8 @@ jobs: environment: integration env: # Required configuration for get-started samples - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} defaults: run: working-directory: python @@ -61,8 +61,8 @@ jobs: environment: integration env: # Foundry configuration - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} # Azure OpenAI configuration AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} @@ -70,12 +70,12 @@ jobs: AZURE_OPENAI_CHAT_MODEL: ${{ vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} AZURE_OPENAI_EMBEDDING_MODEL: ${{ vars.AZURE_OPENAI_EMBEDDING_DEPLOYMENT_NAME || vars.AZUREOPENAI__EMBEDDINGDEPLOYMENTNAME }} # OpenAI configuration - OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} - OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI__CHATMODELID }} - OPENAI_CHAT_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_CHAT_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} # GitHub MCP GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - OPENAI_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} + OPENAI_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} # Observability ENABLE_INSTRUMENTATION: "true" defaults: @@ -122,10 +122,10 @@ jobs: runs-on: ubuntu-latest environment: integration env: - OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} - OPENAI_MODEL: ${{ vars.OPENAI__CHATMODELID }} - OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI__CHATMODELID }} - OPENAI_CHAT_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_MODEL: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_CHAT_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} defaults: run: working-directory: python @@ -329,12 +329,11 @@ jobs: validate-02-agents-foundry: name: Validate 02-agents/providers/foundry - if: false # Temporarily disabled - provider folder also contains the local Foundry sample runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} FOUNDRY_AGENT_NAME: ${{ vars.FOUNDRY_AGENT_NAME || '' }} FOUNDRY_AGENT_VERSION: ${{ vars.FOUNDRY_AGENT_VERSION || '' }} defaults: @@ -445,8 +444,8 @@ jobs: runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} defaults: run: working-directory: python @@ -479,12 +478,11 @@ jobs: validate-04-hosting: name: Validate 04-hosting - if: false # Temporarily disabled because of sample complexity runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} # A2A configuration A2A_AGENT_HOST: http://localhost:5001/ defaults: @@ -518,8 +516,8 @@ jobs: runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} # Azure OpenAI configuration AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} @@ -560,16 +558,16 @@ jobs: runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} # Azure OpenAI configuration AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} # OpenAI configuration - OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} - OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI__CHATMODELID }} - OPENAI_CHAT_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} - OPENAI_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_CHAT_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} + OPENAI_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} defaults: run: working-directory: python @@ -610,20 +608,21 @@ jobs: runs-on: ubuntu-latest environment: integration env: - FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT || vars.AZURE_AI_PROJECT_ENDPOINT }} - FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} + FOUNDRY_PROJECT_ENDPOINT: ${{ vars.FOUNDRY_PROJECT_ENDPOINT }} + FOUNDRY_MODEL: ${{ vars.FOUNDRY_MODEL }} # Azure OpenAI configuration for AF AZURE_OPENAI_ENDPOINT: ${{ vars.AZUREOPENAI__ENDPOINT }} AZURE_OPENAI_MODEL: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME || vars.AZUREOPENAI__RESPONSESDEPLOYMENTNAME }} # Azure OpenAI configuration for SK AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} # OpenAI key - OPENAI_API_KEY: ${{ secrets.OPENAI__APIKEY }} - OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI__CHATMODELID }} - OPENAI_CHAT_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} - OPENAI_MODEL: ${{ vars.OPENAI__RESPONSESMODELID }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + OPENAI_CHAT_COMPLETION_MODEL: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_CHAT_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} + OPENAI_MODEL: ${{ vars.OPENAI_REASONING_MODEL_NAME }} # OpenAI configuration for SK - OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI__CHATMODELID }} + OPENAI_CHAT_MODEL_ID: ${{ vars.OPENAI_CHAT_MODEL_NAME }} + OPENAI_RESPONSES_MODEL_ID: ${{ vars.OPENAI__RESPONSESMODELID }} # Copilot Studio COPILOTSTUDIOAGENT__ENVIRONMENTID: ${{ secrets.COPILOTSTUDIOAGENT__ENVIRONMENTID }} COPILOTSTUDIOAGENT__SCHEMANAME: ${{ secrets.COPILOTSTUDIOAGENT__SCHEMANAME }} diff --git a/python/samples/autogen-migration/single_agent/01_basic_agent.py b/python/samples/autogen-migration/single_agent/01_basic_agent.py index bfa0c915eae..a9bcb3da359 100644 --- a/python/samples/autogen-migration/single_agent/01_basic_agent.py +++ b/python/samples/autogen-migration/single_agent/01_basic_agent.py @@ -1,12 +1,14 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", # "autogen-agentchat", # "autogen-ext[openai]", +# "python-dotenv", # ] # /// # Run with any PEP 723 compatible runner, e.g.: -# uv run samples/autogen-migration/single_agent/01_basic_assistant_agent.py +# uv run samples/autogen-migration/single_agent/01_basic_agent.py # Copyright (c) Microsoft. All rights reserved. diff --git a/python/samples/semantic-kernel-migration/chat_completion/01_basic_chat_completion.py b/python/samples/semantic-kernel-migration/chat_completion/01_basic_chat_completion.py index ebd10122dc3..d4493b22a91 100644 --- a/python/samples/semantic-kernel-migration/chat_completion/01_basic_chat_completion.py +++ b/python/samples/semantic-kernel-migration/chat_completion/01_basic_chat_completion.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/chat_completion/02_chat_completion_with_tool.py b/python/samples/semantic-kernel-migration/chat_completion/02_chat_completion_with_tool.py index d5b12035184..21397b62c9a 100644 --- a/python/samples/semantic-kernel-migration/chat_completion/02_chat_completion_with_tool.py +++ b/python/samples/semantic-kernel-migration/chat_completion/02_chat_completion_with_tool.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/chat_completion/03_chat_completion_thread_and_stream.py b/python/samples/semantic-kernel-migration/chat_completion/03_chat_completion_thread_and_stream.py index f656220f204..b6fe966fe67 100644 --- a/python/samples/semantic-kernel-migration/chat_completion/03_chat_completion_thread_and_stream.py +++ b/python/samples/semantic-kernel-migration/chat_completion/03_chat_completion_thread_and_stream.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/scripts/sample_validation/skills/hosting-sample-runner/SKILL.md b/python/scripts/sample_validation/skills/hosting-sample-runner/SKILL.md new file mode 100644 index 00000000000..58412c6450a --- /dev/null +++ b/python/scripts/sample_validation/skills/hosting-sample-runner/SKILL.md @@ -0,0 +1,50 @@ +--- +name: hosting-sample-runner +description: Decide how to validate a hosting sample (for example anything under 04-hosting that starts a server, function host, or deployed agent). Use when a sample hosts an agent or workflow and is run by starting a local server/host and calling it, or by deploying to a cloud provider. +license: MIT +compatibility: Works with any model that supports tool use. +metadata: + author: agent-framework-samples + version: "1.0" +--- + +## Usage + +Hosting samples are different from ordinary scripts: instead of running to +completion, they typically start a server, function host, or hosted agent and +are exercised by a separate client call. Each hosting sample includes a +`README.md` that documents how to set up and run it. + +When validating a hosting sample: + +1. Read the sample's `README.md` (and any sibling READMEs in parent + directories) to understand how the sample is meant to be run. +2. Decide whether the sample can be run **locally** — that is, fully exercised + on this machine without deploying to a cloud provider (for example Azure + Functions deployment, an Azure Container App, or a Foundry hosted-agent + publish step). A sample is locally runnable when its README describes a + local launch path, such as starting a local server (e.g. Hypercorn, + `uv run python app.py`, the Functions Core Tools `func start`, or a durable + task worker) and then calling it from a local client/HTTP request. + +### If the sample can be run locally + +Follow the README's local setup and run instructions: + +1. Install any required dependencies it lists. +2. Start the host process in the background (it will not exit on its own). +3. Exercise it as the README describes — run the companion client script, + send the documented HTTP request, or otherwise drive a single end-to-end + interaction. +4. If the interaction succeeds, stop the host process and mark the sample as + `success`. +5. If the host fails to start or the interaction errors, treat it as a + `failure` and investigate the error. + +### If the sample cannot be run locally + +If the README only documents a cloud deployment path (for example deploying +to Azure Functions, publishing a Foundry hosted agent, or otherwise requiring +provisioned cloud infrastructure to exercise the sample), do not attempt to +deploy it. Mark the sample as `missing_setup` and note in the output that it +requires cloud deployment that cannot be performed locally. From 0ffeb715cb767df0d1206e4bac4b309cb4820ddd Mon Sep 17 00:00:00 2001 From: Tao Chen Date: Thu, 25 Jun 2026 13:32:38 -0700 Subject: [PATCH 3/3] Fix migration samples --- .github/workflows/python-sample-validation.yml | 2 +- .../copilot_studio/01_basic_copilot_studio_agent.py | 11 +++++++++++ .../copilot_studio/02_copilot_studio_streaming.py | 11 +++++++++++ .../openai_responses/01_basic_responses_agent.py | 2 ++ .../openai_responses/02_responses_agent_with_tool.py | 2 ++ .../03_responses_agent_structured_output.py | 2 ++ .../orchestrations/concurrent_basic.py | 3 +++ .../orchestrations/group_chat.py | 3 +++ .../orchestrations/handoff.py | 3 +++ .../orchestrations/magentic.py | 3 +++ .../orchestrations/sequential.py | 3 +++ .../processes/fan_out_fan_in_process.py | 2 ++ .../processes/nested_process.py | 2 ++ 13 files changed, 48 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-sample-validation.yml b/.github/workflows/python-sample-validation.yml index 320f9c38b11..116c1595b7d 100644 --- a/.github/workflows/python-sample-validation.yml +++ b/.github/workflows/python-sample-validation.yml @@ -9,7 +9,7 @@ env: # Configure a constant location for the uv cache UV_CACHE_DIR: /tmp/.uv-cache # GitHub Copilot configuration - GITHUB_COPILOT_MODEL: claude-opus-4.6 + GITHUB_COPILOT_MODEL: claude-opus-4.8 COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} permissions: diff --git a/python/samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py b/python/samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py index a477181b264..240a03440dd 100644 --- a/python/samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py +++ b/python/samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py @@ -1,11 +1,22 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-copilotstudio", +# "python-dotenv", # "semantic-kernel", # ] # /// # Run with any PEP 723 compatible runner, e.g.: # uv run samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py +# +# NOTE: The metadata above resolves the Agent Framework half only. +# The Semantic Kernel half (run_semantic_kernel) requires the older +# dot-namespace Microsoft Agents SDK (microsoft.agents.copilotstudio.client and +# microsoft.agents.core, from microsoft-agents-copilotstudio-client<0.3), while +# Agent Framework requires the newer underscore-namespace SDK +# (microsoft_agents.copilotstudio.client, from +# microsoft-agents-copilotstudio-client>=0.3.1). These two generations cannot be +# installed in the same environment, so run each half in its own isolated env. # Copyright (c) Microsoft. All rights reserved. """Call a Copilot Studio agent with SK and Agent Framework.""" diff --git a/python/samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py b/python/samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py index 97ef158c532..991b4b5bf1c 100644 --- a/python/samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py +++ b/python/samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py @@ -1,11 +1,22 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-copilotstudio", +# "python-dotenv", # "semantic-kernel", # ] # /// # Run with any PEP 723 compatible runner, e.g.: # uv run samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py +# +# NOTE: The metadata above resolves the Agent Framework half only. +# The Semantic Kernel half (run_semantic_kernel) requires the older +# dot-namespace Microsoft Agents SDK (microsoft.agents.copilotstudio.client and +# microsoft.agents.core, from microsoft-agents-copilotstudio-client<0.3), while +# Agent Framework requires the newer underscore-namespace SDK +# (microsoft_agents.copilotstudio.client, from +# microsoft-agents-copilotstudio-client>=0.3.1). These two generations cannot be +# installed in the same environment, so run each half in its own isolated env. # Copyright (c) Microsoft. All rights reserved. """Stream responses from Copilot Studio agents in SK and AF.""" diff --git a/python/samples/semantic-kernel-migration/openai_responses/01_basic_responses_agent.py b/python/samples/semantic-kernel-migration/openai_responses/01_basic_responses_agent.py index d74487d1e8f..b360da34e8f 100644 --- a/python/samples/semantic-kernel-migration/openai_responses/01_basic_responses_agent.py +++ b/python/samples/semantic-kernel-migration/openai_responses/01_basic_responses_agent.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/openai_responses/02_responses_agent_with_tool.py b/python/samples/semantic-kernel-migration/openai_responses/02_responses_agent_with_tool.py index 01b783aff90..09b68fb7d00 100644 --- a/python/samples/semantic-kernel-migration/openai_responses/02_responses_agent_with_tool.py +++ b/python/samples/semantic-kernel-migration/openai_responses/02_responses_agent_with_tool.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/openai_responses/03_responses_agent_structured_output.py b/python/samples/semantic-kernel-migration/openai_responses/03_responses_agent_structured_output.py index cbfbf470a08..04fad5754ce 100644 --- a/python/samples/semantic-kernel-migration/openai_responses/03_responses_agent_structured_output.py +++ b/python/samples/semantic-kernel-migration/openai_responses/03_responses_agent_structured_output.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/orchestrations/concurrent_basic.py b/python/samples/semantic-kernel-migration/orchestrations/concurrent_basic.py index 11140aa8752..1a9470b7135 100644 --- a/python/samples/semantic-kernel-migration/orchestrations/concurrent_basic.py +++ b/python/samples/semantic-kernel-migration/orchestrations/concurrent_basic.py @@ -1,6 +1,9 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "agent-framework-orchestrations", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/orchestrations/group_chat.py b/python/samples/semantic-kernel-migration/orchestrations/group_chat.py index 89613072d8c..8c64bcb4c13 100644 --- a/python/samples/semantic-kernel-migration/orchestrations/group_chat.py +++ b/python/samples/semantic-kernel-migration/orchestrations/group_chat.py @@ -1,6 +1,9 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "agent-framework-orchestrations", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/orchestrations/handoff.py b/python/samples/semantic-kernel-migration/orchestrations/handoff.py index 5313c2943f8..08f77400611 100644 --- a/python/samples/semantic-kernel-migration/orchestrations/handoff.py +++ b/python/samples/semantic-kernel-migration/orchestrations/handoff.py @@ -1,6 +1,9 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "agent-framework-orchestrations", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/orchestrations/magentic.py b/python/samples/semantic-kernel-migration/orchestrations/magentic.py index 4ce62492e21..5e03f0a3037 100644 --- a/python/samples/semantic-kernel-migration/orchestrations/magentic.py +++ b/python/samples/semantic-kernel-migration/orchestrations/magentic.py @@ -1,6 +1,9 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "agent-framework-orchestrations", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/orchestrations/sequential.py b/python/samples/semantic-kernel-migration/orchestrations/sequential.py index 22a2be6f23e..c40792561d2 100644 --- a/python/samples/semantic-kernel-migration/orchestrations/sequential.py +++ b/python/samples/semantic-kernel-migration/orchestrations/sequential.py @@ -1,6 +1,9 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-openai", +# "agent-framework-orchestrations", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/processes/fan_out_fan_in_process.py b/python/samples/semantic-kernel-migration/processes/fan_out_fan_in_process.py index 37e210e80b8..4463de36c40 100644 --- a/python/samples/semantic-kernel-migration/processes/fan_out_fan_in_process.py +++ b/python/samples/semantic-kernel-migration/processes/fan_out_fan_in_process.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-core", +# "python-dotenv", # "semantic-kernel", # ] # /// diff --git a/python/samples/semantic-kernel-migration/processes/nested_process.py b/python/samples/semantic-kernel-migration/processes/nested_process.py index ee8d889229a..61a9aef7ee6 100644 --- a/python/samples/semantic-kernel-migration/processes/nested_process.py +++ b/python/samples/semantic-kernel-migration/processes/nested_process.py @@ -1,6 +1,8 @@ # /// script # requires-python = ">=3.10" # dependencies = [ +# "agent-framework-core", +# "python-dotenv", # "semantic-kernel", # ] # ///