File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
samples-v2/openai_agents/customer_service Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations as _annotations
2
2
3
3
import random
4
- import uuid
5
4
5
+ from azure .durable_functions .openai_agents import DurableAIAgentContext
6
6
from pydantic import BaseModel
7
7
8
8
from agents import (
@@ -138,18 +138,18 @@ async def on_seat_booking_handoff(context: RunContextWrapper[AirlineAgentContext
138
138
### RUN
139
139
140
140
141
- def main (context ):
141
+ def main (context : DurableAIAgentContext ):
142
142
current_agent : Agent [AirlineAgentContext ] = triage_agent
143
143
input_items : list [TResponseInputItem ] = []
144
- context = AirlineAgentContext ()
144
+ airline_agent_context = AirlineAgentContext ()
145
145
146
146
conversation_id = context .instance_id
147
147
148
148
while True :
149
149
user_input = context .wait_for_external_event ("UserInput" )
150
150
with trace ("Customer service" , group_id = conversation_id ):
151
151
input_items .append ({"content" : user_input , "role" : "user" })
152
- result = Runner .run_sync (current_agent , input_items , context = context )
152
+ result = Runner .run_sync (current_agent , input_items , context = airline_agent_context )
153
153
154
154
for new_item in result .new_items :
155
155
agent_name = new_item .agent .name
You can’t perform that action at this time.
0 commit comments