from agents import Agent, Runner, handoff, trace
import asyncio
order_agent = Agent(
name="Order Agent",
instructions="주문 조회, 배송 상태 확인을 담당합니다.",
tools=[lookup_order],
)
refund_agent = Agent(
name="Refund Agent",
instructions="환불, 반품 관련 문의를 처리합니다.",
tools=[check_refund_policy],
)
triage_agent = Agent(
name="Triage Agent",
instructions="""고객 문의를 분류하여 적절한 에이전트로 전달하세요.""",
handoffs=[handoff(order_agent), handoff(refund_agent)],
)
async def main():
with trace("customer-support"):
result = await Runner.run(
triage_agent,
"주문번호 ORD-2026-1234 배송이 언제 오나요?"
)
print(result.final_output)
asyncio.run(main())