5.2 · Transfer the Call or Ask a Colleague? (AI Agent Handoffs vs Agents-as-Tools)
Whiteboard Bytes
0:00 / 0:00
5.2 · Transfer the Call or Ask a Colleague? (AI Agent Handoffs vs Agents-as-Tools)
4 просмотра · 3 дн. назад
Whiteboard Bytes
11 подписчиков
4 просмотра · 3 дн. назад
Priya wants a refund, and another ticket in the Nimbus queue has two problems. Should the first agent transfer the customer to a specialist, or ask specialists for help and answer itself? Follow both shapes with the same three agents: a handoff, where triage's model sees transfer_to_refunds as just another tool, its run ends with stop_reason handoff, and refunds takes over and writes the reply; and agents as tools, where a manager calls ask_shipping and ask_refunds, each a fresh specialist run, gets one string back from each and writes one combined reply. See exactly what each agent saw (11 messages in the refunds run, 6 in the manager's), compare the two side by side, weigh the trade-off, then write both in the OpenAI Agents SDK (handoffs=[...] vs agent.as_tool(...)). Lesson 5.2 of the AI Agents course. Nimbus, Priya, Rahul, the orders, amounts and traces are demo data from deterministic stand-in models in the course code: routing is a keyword rule and the manager's split is hard-coded; a real LLM chooses the handoff or tool call itself. The SDK code on screen is not run in the lesson.
Chapters:
0:00 Transfer the call, or ask a colleague?
1:20 A handoff, drawn once
1:44 Who writes Priya's reply?
2:31 What the receiver sees: 11 messages
3:18 Agents as tools: ask a colleague
3:50 What the manager sees: one string
4:38 Side by side, and the trade-off
5:39 The same idea in the OpenAI Agents SDK
6:29 Quiz: Rahul's delivery ticket
Mid-video quiz: Rahul's ticket, "Where is my order A1002?", goes through the same handoff team, and triage transfers it to shipping. As a manager's worker, shipping's run held 5 messages. How many messages are in shipping's run after the handoff, and who writes Rahul's answer? A) 5, written by triage, B) 7, written by shipping, C) 8, written by shipping. The answer is in the video.
Sources:
OpenAI Agents SDK, Handoffs: https://openai.github.io/openai-agent...
OpenAI Agents SDK, Tools (Agents as tools): https://openai.github.io/openai-agent...
PyPI, openai-agents (0.24.0 as of Oct 2026): https://pypi.org/project/openai-agents/
OpenAI Agents SDK, Results (last_agent): https://openai.github.io/openai-agent...
Instagram: @whiteboardbytes
#aiagents #llm #python