From fab1f9953b76e1d053982b86aa26561703b2fcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Fri, 12 Jun 2026 17:17:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_ai_agent/models/ai_agent.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yuthon_ai_agent/models/ai_agent.py b/yuthon_ai_agent/models/ai_agent.py index 07b2a4f54..5c1d5aeeb 100644 --- a/yuthon_ai_agent/models/ai_agent.py +++ b/yuthon_ai_agent/models/ai_agent.py @@ -813,12 +813,11 @@ class AiConversation(models.Model): (full_content or '')[:300], ) - # 1. 保存用户消息(content 存原始用户文本,ocr_content 存 OCR 结果, - # full_content 带 OCR 的版本发给 AI,前端通过 attachments 字段渲染附件预览) + # 1. 保存用户消息(content 存 full_content 即 OCR+原文,前端 renderContent 会自动 strip 附件标记) msg_vals = { 'conversation_id': self.id, 'role': 'user', - 'content': content, # 存干净的用户原文,不含 OCR 前缀 + 'content': full_content, # OCR 拼好的完整内容,发给 AI 的就是这个 } if msg_attachment_ids: msg_vals['attachment_ids'] = msg_attachment_ids