()
| 57 | |
| 58 | |
| 59 | async 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 | |
| 82 | if __name__ == "__main__": |
no test coverage detected