Skip to main content
Use mode=TeamMode.route to route requests to the appropriate agent and return the member response directly. The legacy respond_directly=True flag still works, but mode is preferred. This example creates a language router with three agents:
  1. English Agent - Responds in English
  2. Japanese Agent - Responds in Japanese
  3. Spanish Agent - Responds in Spanish
1

Create a Python file

respond_directly.py
2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

5

Run Team