From 5237911dec62e9e420fd1847cc62f555adc3d98c Mon Sep 17 00:00:00 2001 From: aifanatic Date: Wed, 21 Oct 2026 09:22:01 -0500 Subject: [PATCH] Python: drop unsupported instructions from AF Copilot Studio migration samples agent_framework.microsoft.CopilotStudioAgent connects to an already published Copilot Studio agent and has no `instructions` parameter, so the Agent Framework half of both Copilot Studio migration samples raised TypeError on construction. Remove the argument and note where the agent's instructions live. Co-Authored-By: Claude Opus 5.5 --- .../copilot_studio/01_basic_copilot_studio_agent.py | 7 +++---- .../copilot_studio/02_copilot_studio_streaming.py | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) 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 240a03440dd..84d3c88ba32 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 @@ -45,10 +45,9 @@ async def run_agent_framework() -> None: from agent_framework.microsoft import CopilotStudioAgent # AF exposes an equivalent CopilotStudioAgent wrapper. - agent = CopilotStudioAgent( - name="PhysicsAgent", - instructions="Answer physics questions concisely.", - ) + # AF connects to an already-published Copilot Studio agent, so its instructions + # are configured in Copilot Studio rather than passed to the wrapper. + agent = CopilotStudioAgent(name="PhysicsAgent") reply = await agent.run("Why is the sky blue?") print("[AF]", reply.text) 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 991b4b5bf1c..5ae6f2f4997 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 @@ -47,10 +47,9 @@ async def run_semantic_kernel() -> None: async def run_agent_framework() -> None: from agent_framework.microsoft import CopilotStudioAgent - agent = CopilotStudioAgent( - name="TourGuide", - instructions="Provide travel recommendations in short bursts.", - ) + # AF connects to an already-published Copilot Studio agent, so its instructions + # are configured in Copilot Studio rather than passed to the wrapper. + agent = CopilotStudioAgent(name="TourGuide") # AF streaming provides incremental AgentResponseUpdate objects. print("[AF][stream]", end=" ") async for update in agent.run("Plan a day in Copenhagen for foodies.", stream=True):