Skip to content

Commit c739447

Browse files
1aifanaticclaude
andauthored
Python: drop unsupported instructions from AF Copilot Studio migration samples (#9577)
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 <[email protected]>
1 parent 621e8e3 commit c739447

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

‎python/samples/semantic-kernel-migration/copilot_studio/01_basic_copilot_studio_agent.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ async def run_agent_framework() -> None:
4545
from agent_framework.microsoft import CopilotStudioAgent
4646

4747
# AF exposes an equivalent CopilotStudioAgent wrapper.
48-
agent = CopilotStudioAgent(
49-
name="PhysicsAgent",
50-
instructions="Answer physics questions concisely.",
51-
)
48+
# AF connects to an already-published Copilot Studio agent, so its instructions
49+
# are configured in Copilot Studio rather than passed to the wrapper.
50+
agent = CopilotStudioAgent(name="PhysicsAgent")
5251
reply = await agent.run("Why is the sky blue?")
5352
print("[AF]", reply.text)
5453

‎python/samples/semantic-kernel-migration/copilot_studio/02_copilot_studio_streaming.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ async def run_semantic_kernel() -> None:
4747
async def run_agent_framework() -> None:
4848
from agent_framework.microsoft import CopilotStudioAgent
4949

50-
agent = CopilotStudioAgent(
51-
name="TourGuide",
52-
instructions="Provide travel recommendations in short bursts.",
53-
)
50+
# AF connects to an already-published Copilot Studio agent, so its instructions
51+
# are configured in Copilot Studio rather than passed to the wrapper.
52+
agent = CopilotStudioAgent(name="TourGuide")
5453
# AF streaming provides incremental AgentResponseUpdate objects.
5554
print("[AF][stream]", end=" ")
5655
async for update in agent.run("Plan a day in Copenhagen for foodies.", stream=True):

0 commit comments

Comments
 (0)