instructions =("You are a translation agent. You use the tools given to you to translate.""If asked for multiple translations, you call the relevant tools."),
tools=[
spanish_agent.as_tool(
tool_name="translate_to_spanish",
tool_description="Translate the user's message to Spanish",),
french_agent.as_tool(
tool_name="translate_to_french",
tool_description="Translate the user's message to French",),
italian_agent.as_tool(
tool_name="translate_to_italian",
tool_description="Translate the user's message to Italian",),],)asyncdefmain():
msg =input("Translate 'hello' to Spanish, French and Italian for me!")
orchestrator_output =await Runner.run(
manager_agent,msg)for message in orchestrator_output.new_messages:print(f"- Translation step: {message.content}")
instructions="You are a customer support agent. You help customers with their questions.",
input_guardrails=[Guardrail(guardrail_function=churn_detection_tripwire),],)asyncdefmain():# This should be okawait Runner.run(customer_support_agent,"Hello!")print("Hello message passed")# This should trip the guardrailtry:await Runner.run(agent,"I think I might cancel my subscription")print("Guardrail didn't trip - this is unexpected")except GuardrailTripwireTriggered:print("Churn detection guardrail tripped")