File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,32 @@ def basic_hello_world_orchestrator(context):
2727
2828@app .orchestration_trigger (context_name = "context" )
2929@durable_openai_agent_orchestrator
30- def basic_hello_world_orchestrator_inline (context ):
30+ def haiku (context ):
3131 agent = Agent (
3232 name = "Assistant" ,
3333 instructions = "You only respond in haikus." ,
3434 )
3535
3636 result = Runner .run_sync (agent , "Tell me about recursion in programming." )
3737 return result .final_output
38+
39+
40+ @app .orchestration_trigger (context_name = "context" )
41+ @durable_openai_agent_orchestrator
42+ def haiku_judge (context ):
43+ writer = Agent (
44+ name = "Writer" ,
45+ instructions = "You only respond in haikus." ,
46+ )
47+
48+ haiku = Runner .run_sync (writer , "Tell me about recursion in programming." )
49+
50+ judge = Agent (
51+ name = "Judge" ,
52+ instructions = "You judge haikus." ,
53+ )
54+
55+ evaluation = Runner .run_sync (judge , f"Is this a good haiku? { haiku .final_output } " )
56+
57+ return [haiku .final_output , "\n \n " + evaluation .final_output ]
58+
You can’t perform that action at this time.
0 commit comments