Python: Fix broken Content API imports in Python samples (#3639)

* Initial plan

* Fix broken import paths for Content API in all Python sample files

Co-authored-by: moonbox3 <35585003+moonbox3@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: moonbox3 <35585003+moonbox3@users.noreply.github.com>
This commit is contained in:
Copilot
2026-02-03 22:48:26 +00:00
committed by GitHub
Unverified
parent f56218fa1e
commit 96d3f2a55e
11 changed files with 30 additions and 30 deletions
@@ -32,12 +32,12 @@ from contextlib import asynccontextmanager
from agent_framework import (
AgentRunUpdateEvent,
ChatAgent,
Content,
HandoffAgentUserRequest,
HandoffBuilder,
HostedCodeInterpreterTool,
HostedFileContent,
RequestInfoEvent,
TextContent,
WorkflowEvent,
WorkflowRunState,
WorkflowStatusEvent,
@@ -76,7 +76,7 @@ def _handle_events(events: list[WorkflowEvent]) -> tuple[list[RequestInfoEvent],
if isinstance(content, HostedFileContent):
file_ids.append(content.file_id)
print(f"[Found HostedFileContent: file_id={content.file_id}]")
elif isinstance(content, TextContent) and content.annotations:
elif content.type == "text" and content.annotations:
for annotation in content.annotations:
if hasattr(annotation, "file_id") and annotation.file_id:
file_ids.append(annotation.file_id)