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):
27
27
28
28
@app .orchestration_trigger (context_name = "context" )
29
29
@durable_openai_agent_orchestrator
30
- def basic_hello_world_orchestrator_inline (context ):
30
+ def haiku (context ):
31
31
agent = Agent (
32
32
name = "Assistant" ,
33
33
instructions = "You only respond in haikus." ,
34
34
)
35
35
36
36
result = Runner .run_sync (agent , "Tell me about recursion in programming." )
37
37
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