Skip to content

Commit 259d1aa

Browse files
committed
Revert "Remove duplicate sample"
This reverts commit 9743392.
1 parent f9c58f3 commit 259d1aa

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

samples-v2/openai_agents/function_app.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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")
5375
async def hello(name: str):
5476
return f"Hello {name}!"
5577

5678

79+
5780
@app.orchestration_trigger(context_name="context")
5881
@durable_openai_agent_orchestrator
5982
def human_in_the_loop(context):

0 commit comments

Comments
 (0)