File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
samples-v2/openai_agents/customer_service Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,10 @@ def main(context: DurableAIAgentContext):
145
145
146
146
conversation_id = context .instance_id
147
147
148
+ context .set_custom_status ("How can I help you today?" )
148
149
while True :
149
150
user_input = yield context .wait_for_external_event ("UserInput" )
151
+ context .set_custom_status ("Thinking..." )
150
152
with trace ("Customer service" , group_id = conversation_id ):
151
153
input_items .append ({"content" : user_input , "role" : "user" })
152
154
result = Runner .run_sync (current_agent , input_items , context = airline_agent_context )
@@ -167,3 +169,5 @@ def main(context: DurableAIAgentContext):
167
169
print (f"{ agent_name } : Skipping item: { new_item .__class__ .__name__ } " )
168
170
input_items = result .to_input_list ()
169
171
current_agent = result .last_agent
172
+
173
+ context .set_custom_status (result .final_output )
You can’t perform that action at this time.
0 commit comments