eraz3r commited on
Commit
537533a
Β·
verified Β·
1 Parent(s): 4f94c64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -421,12 +421,12 @@ def _parse_ids(text, valid_ids):
421
  return [int(n) for n in _re.findall(r'\b(\d+)\b', text) if int(n) in valid_ids]
422
 
423
  def _bot(text):
424
- """Return assistant message dict for Gradio Chatbot type='messages'."""
425
- return {"role": "assistant", "content": text}
426
 
427
  def _usr(text):
428
- """Return user message dict for Gradio Chatbot type='messages'."""
429
- return {"role": "user", "content": text}
430
 
431
  def handle_start_journal(user_id):
432
  blank_outputs = ([], [], False,
@@ -970,7 +970,7 @@ with gr.Blocks(title="\U0001f9e0 Second Brain") as demo:
970
  # ── TAB 3: JOURNAL ────────────────────────────────────────────
971
  with gr.Tab("\U0001f4d3 Journal"):
972
  gr.HTML('<p style="color:#475569;font-size:13px;margin-bottom:12px">End-of-day reflection. Chat naturally \u2014 AI marks tasks, asks questions, updates your profile.</p>')
973
- journal_chatbot = gr.Chatbot(label="", height=440, type="messages")
974
  with gr.Row():
975
  j_answer = gr.Textbox(label="", placeholder="Type or use the mic\u2026", lines=1, scale=5, interactive=False, show_label=False)
976
  j_audio_in = gr.Audio(sources=["microphone"], type="filepath", label="\U0001f3a4", scale=1, interactive=False)
 
421
  return [int(n) for n in _re.findall(r'\b(\d+)\b', text) if int(n) in valid_ids]
422
 
423
  def _bot(text):
424
+ """Return assistant message tuple for Gradio Chatbot (tuple mode)."""
425
+ return (None, text)
426
 
427
  def _usr(text):
428
+ """Return user message tuple for Gradio Chatbot (tuple mode)."""
429
+ return (text, None)
430
 
431
  def handle_start_journal(user_id):
432
  blank_outputs = ([], [], False,
 
970
  # ── TAB 3: JOURNAL ────────────────────────────────────────────
971
  with gr.Tab("\U0001f4d3 Journal"):
972
  gr.HTML('<p style="color:#475569;font-size:13px;margin-bottom:12px">End-of-day reflection. Chat naturally \u2014 AI marks tasks, asks questions, updates your profile.</p>')
973
+ journal_chatbot = gr.Chatbot(label="", height=440)
974
  with gr.Row():
975
  j_answer = gr.Textbox(label="", placeholder="Type or use the mic\u2026", lines=1, scale=5, interactive=False, show_label=False)
976
  j_audio_in = gr.Audio(sources=["microphone"], type="filepath", label="\U0001f3a4", scale=1, interactive=False)