Skip to content

Commit d38ef3a

Browse files
committed
Add basic_hello_world_orchestrator_inline
1 parent 7526494 commit d38ef3a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

samples-v2/openai_agents/function_app.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import azure.functions as func
2+
from agents import Agent, Runner
23
from durable_decorators import durable_openai_agent_orchestrator
34
from model_activity import create_invoke_model_activity
45

@@ -22,3 +23,15 @@ async def orchestration_starter(req: func.HttpRequest, client):
2223
@durable_openai_agent_orchestrator
2324
def basic_hello_world_orchestrator(context):
2425
return basic.hello_world.main()
26+
27+
28+
@app.orchestration_trigger(context_name="context")
29+
@durable_openai_agent_orchestrator
30+
def basic_hello_world_orchestrator_inline(context):
31+
agent = Agent(
32+
name="Assistant",
33+
instructions="You only respond in haikus.",
34+
)
35+
36+
result = Runner.run_sync(agent, "Tell me about recursion in programming.")
37+
return result.final_output

0 commit comments

Comments
 (0)