Skip to content

Commit 811e219

Browse files
committed
Fix CoT handling to ensure proper status updates during processing
1 parent 8a5b570 commit 811e219

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: chatbot/server.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -902,13 +902,14 @@ async def send_update(session_id):
902902
# Send thinking status to client and ask LLM for answer
903903
await sio.emit('update', {'update': 'Thinking... ', 'voice': 'ai'},room=session_id)
904904
answer = await ask_context(temp_context)
905+
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
905906
# Load request for CoT conclusion into conversational thread
906907
cot_prompt = expand_prompt(prompts["chain_of_thought_summary"], {"context_str": answer,
907908
"prompt": client[session_id]["cot_prompt"]})
908909
client[session_id]["prompt"] = cot_prompt
909910
except Exception as erro:
910911
log(f"CoT error - continuing with original prompt: {erro}")
911-
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
912+
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
912913
else:
913914
client_cot = False
914915
try:

0 commit comments

Comments
 (0)