CultriX commited on
Commit
b6ec3ec
·
verified ·
1 Parent(s): f8ccbbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -313,23 +313,23 @@ def process_conversation_generator(task_message: str, api_key: str,
313
  if isinstance(msg, tuple):
314
  if msg[0] in ("update", "result"):
315
  # Yield the updated conversation history in proper format.
316
- yield gr.Chatbot.update(value=convert_history(msg[1]), visible=True)
317
  else:
318
- # For log messages (e.g., "[Orchestrator]", ...), ignore or handle separately.
319
  pass
320
  except queue.Empty:
321
  pass
322
  time.sleep(0.1)
323
 
324
  # Final update if needed
325
- yield gr.Chatbot.update(visible=True)
326
 
327
  # -------------------- Multi-Agent Chat Function --------------------
328
  def multi_agent_chat(message: str, openai_api_key: str = None) -> Generator[Any, None, None]:
329
  if not openai_api_key:
330
  openai_api_key = os.getenv("OPENAI_API_KEY")
331
  if not openai_api_key:
332
- yield gr.Chatbot.update(value=[{"role": "assistant", "content": "Error: API key not provided."}])
333
  return
334
  human_event = threading.Event()
335
  human_input_queue = queue.Queue()
 
313
  if isinstance(msg, tuple):
314
  if msg[0] in ("update", "result"):
315
  # Yield the updated conversation history in proper format.
316
+ yield gr.update(value=convert_history(msg[1]), visible=True)
317
  else:
318
+ # Log messages can be printed or handled here if needed.
319
  pass
320
  except queue.Empty:
321
  pass
322
  time.sleep(0.1)
323
 
324
  # Final update if needed
325
+ yield gr.update(visible=True)
326
 
327
  # -------------------- Multi-Agent Chat Function --------------------
328
  def multi_agent_chat(message: str, openai_api_key: str = None) -> Generator[Any, None, None]:
329
  if not openai_api_key:
330
  openai_api_key = os.getenv("OPENAI_API_KEY")
331
  if not openai_api_key:
332
+ yield gr.update(value=[{"role": "assistant", "content": "Error: API key not provided."}])
333
  return
334
  human_event = threading.Event()
335
  human_input_queue = queue.Queue()