MCPcopy
hub / github.com/openai/openai-agents-python / main

Function main

examples/agent_patterns/agents_as_tools.py:59–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58
59async def main():
60 msg = input_with_fallback(
61 "Hi! What would you like translated, and to which languages? ",
62 "Translate 'Hello, world!' to French and Spanish.",
63 )
64
65 # Run the entire orchestration in a single trace
66 with trace("Orchestrator evaluator"):
67 orchestrator_result = await Runner.run(orchestrator_agent, msg)
68
69 for item in orchestrator_result.new_items:
70 if isinstance(item, MessageOutputItem):
71 text = ItemHelpers.text_message_output(item)
72 if text:
73 print(f" - Translation step: {text}")
74
75 synthesizer_result = await Runner.run(
76 synthesizer_agent, orchestrator_result.to_input_list()
77 )
78
79 print(f"\n\nFinal response:\n{synthesizer_result.final_output}")
80
81
82if __name__ == "__main__":

Callers 1

agents_as_tools.pyFile · 0.70

Calls 5

input_with_fallbackFunction · 0.90
traceFunction · 0.90
text_message_outputMethod · 0.80
runMethod · 0.45
to_input_listMethod · 0.45

Tested by

no test coverage detected