Skip to content

Commit 1c3b3ff

Browse files
committed
Distinguish between DurableAIAgentContext and AirlineAgentContext
1 parent 82a89c8 commit 1c3b3ff

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

samples-v2/openai_agents/customer_service/customer_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations as _annotations
22

33
import random
4-
import uuid
54

5+
from azure.durable_functions.openai_agents import DurableAIAgentContext
66
from pydantic import BaseModel
77

88
from agents import (
@@ -138,18 +138,18 @@ async def on_seat_booking_handoff(context: RunContextWrapper[AirlineAgentContext
138138
### RUN
139139

140140

141-
def main(context):
141+
def main(context: DurableAIAgentContext):
142142
current_agent: Agent[AirlineAgentContext] = triage_agent
143143
input_items: list[TResponseInputItem] = []
144-
context = AirlineAgentContext()
144+
airline_agent_context = AirlineAgentContext()
145145

146146
conversation_id = context.instance_id
147147

148148
while True:
149149
user_input = context.wait_for_external_event("UserInput")
150150
with trace("Customer service", group_id=conversation_id):
151151
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)
153153

154154
for new_item in result.new_items:
155155
agent_name = new_item.agent.name

0 commit comments

Comments
 (0)