Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9402b82

Browse filesBrowse files
committed
remove comments
1 parent cb77ea3 commit 9402b82
Copy full SHA for 9402b82

File tree

1 file changed

+3
-8
lines changed
Filter options

1 file changed

+3
-8
lines changed

‎examples/customer_service/main.py

Copy file name to clipboardExpand all lines: examples/customer_service/main.py
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from __future__ import annotations
1+
from __future__ import annotations as _annotations
22

33
import asyncio
44
import random
55
import uuid
66

77
from pydantic import BaseModel
88

9-
from src.agents import (
9+
from agents import (
1010
Agent,
1111
HandoffOutputItem,
1212
ItemHelpers,
@@ -22,7 +22,7 @@
2222
handoff,
2323
trace,
2424
)
25-
from src.agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX
25+
from agents.extensions.handoff_prompt import RECOMMENDED_PROMPT_PREFIX
2626

2727
### CONTEXT
2828

@@ -162,20 +162,15 @@ async def main():
162162
for new_item in result.new_items:
163163
agent_name = new_item.agent.name
164164
if isinstance(new_item, MessageOutputItem):
165-
# In tool_choice="required" scenarios, the agent won't produce bare messages;
166-
# instead it will call `respond_to_user`. But if the example is run without
167-
# requiring tool_choice, this branch will handle direct messages.
168165
print(f"{agent_name}: {ItemHelpers.text_message_output(new_item)}")
169166
elif isinstance(new_item, HandoffOutputItem):
170167
print(
171168
f"Handed off from {new_item.source_agent.name} to {new_item.target_agent.name}"
172169
)
173170
elif isinstance(new_item, ToolCallItem):
174-
# Stash the name of the tool call so we can treat respond_to_user specially
175171
last_tool_name = getattr(new_item.raw_item, "name", None)
176172
print(f"{agent_name} called tool:{f' {last_tool_name}' if last_tool_name else ''}")
177173
elif isinstance(new_item, ToolCallOutputItem):
178-
# If the tool call was respond_to_user, treat its output as the message to display.
179174
if last_tool_name == "respond_to_user":
180175
print(f"{agent_name}: {new_item.output}")
181176
else:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.