File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,38 @@ def search_agent(context):
188
188
return result .final_output
189
189
190
190
191
+ def french_agent () -> Agent :
192
+ return Agent (
193
+ name = "french_agent" ,
194
+ instructions = "You only speak French" ,
195
+ )
196
+
197
+ def spanish_agent () -> Agent :
198
+ return Agent (
199
+ name = "spanish_agent" ,
200
+ instructions = "You only speak Spanish" ,
201
+ )
202
+
203
+ def english_agent () -> Agent :
204
+ return Agent (
205
+ name = "english_agent" ,
206
+ instructions = "You only speak English" ,
207
+ )
208
+
209
+ def triage_agent () -> Agent :
210
+ return Agent (
211
+ name = "triage_agent" ,
212
+ instructions = "Handoff to the appropriate agent based on the language of the request." ,
213
+ handoffs = [french_agent (), spanish_agent (), english_agent ()],
214
+ )
215
+
216
+ @app .orchestration_trigger (context_name = "context" )
217
+ @durable_openai_agent_orchestrator
218
+ def routing (context ):
219
+ result = Runner .run_sync (triage_agent (), input = "Hello, how are you?" )
220
+ return result .final_output
221
+
222
+
191
223
#region Implementation details
192
224
193
225
create_invoke_model_activity (app ) # TODO: Can we hide this line?
You can’t perform that action at this time.
0 commit comments