Skip to main content
In Route Mode, the Team Leader directs user queries to the most appropriate team member based on the content of the request. The Team Leader acts as a smart router, analyzing the query and selecting the best-suited agent to handle it. The member’s response is then returned directly to the user.

How Route Mode Works

In “route” mode:
  1. The team receives a user query
  2. A Team Leader analyzes the query to determine which team member has the right expertise
  3. The query is forwarded to the selected team member
  4. The response from the team member is returned directly to the user
This mode is particularly useful when you have specialized agents with distinct expertise areas and want to automatically direct queries to the right specialist.
1

Create Multi Language Team

Create a file multi_language_team.py
multi_language_team.py
2

Run the team

Install libraries
Run the team

Structured Output with Route Mode

One powerful feature of route mode is its ability to maintain structured output from member agents. When using a Pydantic model for the response, the response from the selected team member will be automatically parsed into the specified structure.

Defining Structured Output Models