diff --git a/app.py b/app.py index c361b86..c1dfb15 100644 --- a/app.py +++ b/app.py @@ -118,8 +118,9 @@ async def respond(message, history, show_thinking, user_id, use_tts, run_ids): # 즉시 상태 표시 — thinking_acc에 누적하지 않음 (임시 메시지) if isinstance(token, dict) and "__status" in token: - status_text = (thinking_acc + "\n\n" + token["__status"]) if thinking_acc else token["__status"] - yield history, "", None, run_ids, _thinking_html(status_text) + if not thinking_acc: + yield history, "", None, run_ids, _status_html(token["__status"]) + # thinking_acc에 내용 있으면 기존 표시 유지 continue # 사고 과정(LLM thinking) — 박스에 추가 @@ -228,21 +229,35 @@ def delete_doc(source): # ── UI 구성 ────────────────────────────────────────────────────── -_THINKING_STYLE = ( +_BOX_STYLE = ( "background:#f9f9f9;border-left:3px solid #bbb;border-radius:6px;" - "padding:10px 14px;max-height:220px;overflow-y:auto;" - "font-size:0.85em;color:#555;white-space:pre-wrap;margin-bottom:6px;" + "padding:8px 14px;margin-bottom:6px;" +) +_CONTENT_STYLE = ( + "margin-top:8px;white-space:pre-wrap;font-size:0.85em;" + "color:#555;max-height:200px;overflow-y:auto;" ) def _thinking_html(text: str, done: bool = False) -> str: + """접기/펼치기 가능한 사고 과정 박스.""" icon = "💭" if done else "🤔" label = "분석 완료" if done else "분석 중..." cursor = "" if done else " ▌" return ( - f'