commit by Kalman.CHENG ☆

This commit is contained in:
chengminglong
2025-08-18 13:05:23 +08:00
parent 12a5e1f44d
commit cb0a72ae71

View File

@@ -166,7 +166,9 @@ async def send_question(request: Request):
result += chunk
print(chunk, end='', flush=True)
except Exception as e:
yield f"data: {json.dumps({'error': str(e)})}\n\n"
no_answer_msg = "暂时无法回答这个问题呢,我专注于【" + theme_object["theme_name"] + "】这方面知识,若需这方面帮助,请告知我更准确的信息吧~"
yield f"data: {json.dumps({'reply': no_answer_msg})}\n\n"
# yield f"data: {json.dumps({'error': str(e)})}\n\n"
finally:
# 保存答案
update_question_sql = f"update t_ai_teaching_model_question set question_answer = '{result}', update_time = now() where id = {question_id}"