Skip to content

Commit d3b7d52

Browse files
Wang-Daojiyuan.wang
andauthored
add status of reasoning in playground (#523)
Co-authored-by: yuan.wang <[email protected]>
1 parent 0a4a935 commit d3b7d52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/memos/api/handlers/chat_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,6 @@ def generate_chat_response() -> Generator[str, None, None]:
425425
f"current_system_prompt: {system_prompt}"
426426
)
427427

428-
yield f"data: {json.dumps({'type': 'status', 'data': '2'})}\n\n"
429-
430428
# Step 3: Generate streaming response from LLM
431429
if (
432430
chat_req.model_name_or_path
@@ -448,9 +446,11 @@ def generate_chat_response() -> Generator[str, None, None]:
448446
for chunk in response_stream:
449447
if chunk == "<think>":
450448
in_think = True
449+
yield f"data: {json.dumps({'type': 'status', 'data': 'reasoning'})}\n\n"
451450
continue
452451
if chunk == "</think>":
453452
in_think = False
453+
yield f"data: {json.dumps({'type': 'status', 'data': '2'})}\n\n"
454454
continue
455455

456456
if in_think:

0 commit comments

Comments
 (0)