File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,34 @@ def haiku_judge(context):
4949 return [haiku .final_output , "\n \n " + evaluation .final_output ]
5050
5151
52+ @app .orchestration_trigger (context_name = "context" )
53+ @durable_openai_agent_orchestrator
54+ def hello_cities (context ):
55+ writer = Agent (
56+ name = "Writer" ,
57+ instructions = "You only respond in haikus." ,
58+ )
59+
60+ topic = yield context .call_activity ("hello" , "Seattle" )
61+
62+ haiku = Runner .run_sync (writer , f"Tell me about '{ topic } '" )
63+
64+ judge = Agent (
65+ name = "Judge" ,
66+ instructions = "You judge haikus." ,
67+ )
68+
69+ evaluation = Runner .run_sync (judge , f"Is this a good haiku? { haiku .final_output } " )
70+
71+ return [haiku .final_output , "\n \n " + evaluation .final_output ]
72+
73+
5274@app .activity_trigger (input_name = "name" )
5375async def hello (name : str ):
5476 return f"Hello { name } !"
5577
5678
79+
5780@app .orchestration_trigger (context_name = "context" )
5881@durable_openai_agent_orchestrator
5982def human_in_the_loop (context ):
You can’t perform that action at this time.
0 commit comments