@@ -47,9 +47,9 @@ Imagine a chatbot that receives queries in different languages. Router Mode enab
47
47
48
48
We’ll define a set of language-specific agents and create a routing team that delegates accordingly.
49
49
50
- #### Step 1: Define Language Agents
50
+ #### Step 1: Define language Agents
51
51
52
- ```
52
+ ``` python
53
53
from agno.agent import Agent
54
54
from agno.models.anthropic import Claude
55
55
from agno.models.deepseek import DeepSeek
@@ -104,7 +104,7 @@ german_agent = Agent(
104
104
105
105
### Step 2: Create the Router Team
106
106
107
- ```
107
+ ``` python
108
108
from agno.team.team import Team
109
109
110
110
multi_language_team = Team(
@@ -134,7 +134,7 @@ multi_language_team = Team(
134
134
135
135
### Step 3: Run Multilingual Examples
136
136
137
- ```
137
+ ``` python
138
138
multi_language_team.print_response(" How are you?" , stream = True ) # English
139
139
multi_language_team.print_response(" 你好吗?" , stream = True ) # Chinese
140
140
multi_language_team.print_response(" お元気ですか?" , stream = True ) # Japanese
@@ -143,7 +143,7 @@ multi_language_team.print_response("Comment allez-vous?", stream=True) # French
143
143
144
144
### Output:
145
145
146
- ```
146
+ ``` python
147
147
[English Agent]: I' m doing great! How can I help you today?
148
148
[Chinese Agent]: 我很好,谢谢你的关心。你呢?
149
149
[Japanese Agent]: 元気です。あなたはお元気ですか?
@@ -171,7 +171,7 @@ multi_language_team.print_response("Comment allez-vous?", stream=True) # French
171
171
<td>Displays individual agent replies for traceability</td>
172
172
</tr>
173
173
<tr>
174
- <td><code>instructions\[]</code></td>
174
+ <td><code>instructions\\ []</code></td>
175
175
<td>Core router logic: detect language, enforce exclusivity, manage fallbacks</td>
176
176
</tr>
177
177
<tr>
@@ -181,8 +181,6 @@ multi_language_team.print_response("Comment allez-vous?", stream=True) # French
181
181
</tbody >
182
182
</table >
183
183
184
-
185
-
186
184
## Why Router Mode works
187
185
188
186
* Context-awareness: Inputs are analyzed for language, not just keywords
0 commit comments