@@ -235,31 +235,31 @@ def agent_orchestration_workflow(context: df.DurableOrchestrationContext):
235235 Returns a dictionary with the original response and translations.
236236 """
237237 input_text = context.get_input()
238-
238+
239239 # Step 1: Get the main agent's response
240240 main_agent = app.get_agent(context, " MyDurableAgent" )
241241 main_response = yield main_agent.run(input_text)
242- agent_response = main_response.get( " response " , " " )
243-
242+ agent_response = main_response.text
243+
244244 # Step 2: Fan out - get the translation agents and run them concurrently
245245 french_agent = app.get_agent(context, " FrenchTranslator" )
246246 spanish_agent = app.get_agent(context, " SpanishTranslator" )
247-
247+
248248 parallel_tasks = [
249249 french_agent.run(agent_response),
250250 spanish_agent.run(agent_response)
251251 ]
252-
252+
253253 # Step 3: Wait for both translation tasks to complete (fan-in)
254- translations = yield context.task_all(parallel_tasks)
255-
254+ translations = yield context.task_all(parallel_tasks) # type: ignore
255+
256256 # Step 4: Combine results into a dictionary
257257 result = {
258258 " original" : agent_response,
259- " french" : translations[0 ].get( " response " , " " ) ,
260- " spanish" : translations[1 ].get( " response " , " " )
259+ " french" : translations[0 ].text ,
260+ " spanish" : translations[1 ].text
261261 }
262-
262+
263263 return result
264264```
265265
0 commit comments