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):
49
49
return [haiku .final_output , "\n \n " + evaluation .final_output ]
50
50
51
51
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
+
52
74
@app .activity_trigger (input_name = "name" )
53
75
async def hello (name : str ):
54
76
return f"Hello { name } !"
55
77
56
78
79
+
57
80
@app .orchestration_trigger (context_name = "context" )
58
81
@durable_openai_agent_orchestrator
59
82
def human_in_the_loop (context ):
You can’t perform that action at this time.
0 commit comments