Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/hosted_mcp/approvals.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def main(verbose: bool, stream: bool):
print(res.final_output)

if verbose:
for item in result.new_items:
for item in res.new_items:
print(item)


Expand Down
2 changes: 1 addition & 1 deletion examples/hosted_mcp/simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def main(verbose: bool, stream: bool):
# The repository is primarily written in multiple languages, including Rust and TypeScript...

if verbose:
for item in result.new_items:
for item in res.new_items:
print(item)


Expand Down
4 changes: 4 additions & 0 deletions src/agents/_run_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
ImageGenerationCall,
LocalShellCall,
McpApprovalRequest,
McpCall,
McpListTools,
)
from openai.types.responses.response_reasoning_item import ResponseReasoningItem
Expand Down Expand Up @@ -456,6 +457,9 @@ def process_model_response(
)
elif isinstance(output, McpListTools):
items.append(MCPListToolsItem(raw_item=output, agent=agent))
elif isinstance(output, McpCall):
items.append(ToolCallItem(raw_item=output, agent=agent))
tools_used.append("mcp")
elif isinstance(output, ImageGenerationCall):
items.append(ToolCallItem(raw_item=output, agent=agent))
tools_used.append("image_generation")
Expand Down