Wendong-Fan commited on
Commit
27210c7
·
verified ·
1 Parent(s): 1f84de7

Update apps/agents/agents.py

Browse files
Files changed (1) hide show
  1. apps/agents/agents.py +4 -12
apps/agents/agents.py CHANGED
@@ -487,18 +487,10 @@ def construct_ui(blocks, api_key: Optional[str] = None) -> None:
487
  chatbot, progress_sl],
488
  queue=False) \
489
  .then(role_playing_chat_init, session_state,
490
- [session_state, chatbot, progress_sl], queue=False)
491
-
492
- chat_bot = gr.Button("Continue Chat", visible=False)
493
- chat_bot.click(
494
- role_playing_chat_cont,
495
- inputs=[session_state],
496
- outputs=[session_state, chatbot, progress_sl, start_bn]
497
- ).then(
498
- lambda: gr.update(visible=False, value=None) # Hide the button
499
- ).then(
500
- lambda: gr.update(visible=True) # Show the button again after a delay
501
- )
502
 
503
  clear_bn.click(stop_session, session_state,
504
  [session_state, progress_sl, start_bn])
 
487
  chatbot, progress_sl],
488
  queue=False) \
489
  .then(role_playing_chat_init, session_state,
490
+ [session_state, chatbot, progress_sl], queue=False) \
491
+ .then(role_playing_chat_cont, session_state,
492
+ [session_state, chatbot, progress_sl, start_bn],
493
+ every=1)
 
 
 
 
 
 
 
 
494
 
495
  clear_bn.click(stop_session, session_state,
496
  [session_state, progress_sl, start_bn])