From f94738f7e7d7ecbd95d51045ab24085ce3171dcd Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Wed, 7 Jan 2026 16:49:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/do/prompt.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/biz/do/prompt.go b/internal/biz/do/prompt.go index b94d235..3993af1 100644 --- a/internal/biz/do/prompt.go +++ b/internal/biz/do/prompt.go @@ -39,6 +39,9 @@ func (f *WithSys) CreatePrompt(ctx context.Context, rec *entitys.Recognize) (mes // }, api.Message{ // 助手回复无需 // Role: "assistant", // 助手角色 // Content: "### 聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 助手回复内容 + }, api.Message{ + Role: "user", // 用户角色 + Content: "历史聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 用户输入内容 }, api.Message{ Role: "user", // 用户角色 Content: content.String(), // 用户输入内容 @@ -63,10 +66,10 @@ func (f *WithSys) getUserContent(ctx context.Context, rec *entitys.Recognize) (c content.WriteString(rec.UserContent.Tag) } - if len(rec.ChatHis.Messages) > 0 { - content.WriteString("### 引用历史聊天记录:\n") - content.WriteString(pkg.JsonStringIgonErr(rec.ChatHis)) - } + // if len(rec.ChatHis.Messages) > 0 { + // content.WriteString("### 引用历史聊天记录:\n") + // content.WriteString(pkg.JsonStringIgonErr(rec.ChatHis)) + // } if hasFile { content.WriteString("\n")