From 5560e879d0d9f3d442be449815d7660ab971916e Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Mon, 26 Jan 2026 16:37:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E9=92=89=E9=92=89?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=9C=BA=E6=99=AF=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/do/prompt.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/biz/do/prompt.go b/internal/biz/do/prompt.go index 648617b..72ad4ec 100644 --- a/internal/biz/do/prompt.go +++ b/internal/biz/do/prompt.go @@ -138,20 +138,24 @@ func (f *WithDingTalkBot) CreatePrompt(ctx context.Context, rec *entitys.Recogni mes = append(prompt, api.Message{ Role: "system", // 系统角色 Content: rec.SystemPrompt, // 系统提示内容 + // }, api.Message{ // 助手回复无需 + // Role: "assistant", // 助手角色 + // Content: "### 聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 助手回复内容 }, api.Message{ - Role: "assistant", // 助手角色 - Content: "### 聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 助手回复内容 + Role: "assistant", // 助手角色 + Content: "用户历史输入:" + pkg.JsonStringIgonErr(rec.ChatHis), // 用户历史输入 }, api.Message{ Role: "user", // 用户角色 Content: content.String(), // 用户输入内容 }) + fmt.Printf("[意图识别]最终prompt:%v", mes) return } func (f *WithDingTalkBot) getUserContent(ctx context.Context, rec *entitys.Recognize) (content strings.Builder, err error) { var hasFile bool - if rec.UserContent.File != nil && len(rec.UserContent.File) > 0 { + if len(rec.UserContent.File) > 0 { hasFile = true } content.WriteString(rec.UserContent.Text)