Skip to content

Commit

Permalink
Fix CoT handling to ensure proper status updates during processing
Browse files Browse the repository at this point in the history
jasonacox committed Jan 3, 2025
1 parent 8a5b570 commit 811e219
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chatbot/server.py
Original file line number Diff line number Diff line change
@@ -902,13 +902,14 @@ async def send_update(session_id):
# Send thinking status to client and ask LLM for answer
await sio.emit('update', {'update': 'Thinking... ', 'voice': 'ai'},room=session_id)
answer = await ask_context(temp_context)
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
# Load request for CoT conclusion into conversational thread
cot_prompt = expand_prompt(prompts["chain_of_thought_summary"], {"context_str": answer,
"prompt": client[session_id]["cot_prompt"]})
client[session_id]["prompt"] = cot_prompt
except Exception as erro:
log(f"CoT error - continuing with original prompt: {erro}")
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
await sio.emit('update', {'update': '\n\n', 'voice': 'ai'},room=session_id)
else:
client_cot = False
try:

0 comments on commit 811e219

Please sign in to comment.