Skip to content

Commit f5b1084

Browse files
committed
Finish the orchestration on 'exit' etc.
1 parent 85ea194 commit f5b1084

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

samples-v2/openai_agents/customer_service/customer_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ def main(context: DurableAIAgentContext):
148148
context.set_custom_status("How can I help you today?")
149149
while True:
150150
user_input = yield context.wait_for_external_event("UserInput")
151+
if user_input is None or user_input.strip().lower() in ["exit", "quit", "bye"]:
152+
context.set_custom_status("Goodbye!")
153+
break
151154
context.set_custom_status("Thinking...")
152155
with trace("Customer service", group_id=conversation_id):
153156
input_items.append({"content": user_input, "role": "user"})

0 commit comments

Comments
 (0)