Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
| 425 |
-
return
|
| 426 |
|
| 427 |
def _usr(text):
|
| 428 |
-
"""Return user message
|
| 429 |
-
return
|
| 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
|
| 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)
|