fix: 调整钉钉机器人场景的提示词
This commit is contained in:
parent
c74fe839d8
commit
5560e879d0
|
|
@ -138,20 +138,24 @@ func (f *WithDingTalkBot) CreatePrompt(ctx context.Context, rec *entitys.Recogni
|
||||||
mes = append(prompt, api.Message{
|
mes = append(prompt, api.Message{
|
||||||
Role: "system", // 系统角色
|
Role: "system", // 系统角色
|
||||||
Content: rec.SystemPrompt, // 系统提示内容
|
Content: rec.SystemPrompt, // 系统提示内容
|
||||||
|
// }, api.Message{ // 助手回复无需
|
||||||
|
// Role: "assistant", // 助手角色
|
||||||
|
// Content: "### 聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 助手回复内容
|
||||||
}, api.Message{
|
}, api.Message{
|
||||||
Role: "assistant", // 助手角色
|
Role: "assistant", // 助手角色
|
||||||
Content: "### 聊天记录:" + pkg.JsonStringIgonErr(rec.ChatHis), // 助手回复内容
|
Content: "用户历史输入:" + pkg.JsonStringIgonErr(rec.ChatHis), // 用户历史输入
|
||||||
}, api.Message{
|
}, api.Message{
|
||||||
Role: "user", // 用户角色
|
Role: "user", // 用户角色
|
||||||
Content: content.String(), // 用户输入内容
|
Content: content.String(), // 用户输入内容
|
||||||
})
|
})
|
||||||
|
fmt.Printf("[意图识别]最终prompt:%v", mes)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *WithDingTalkBot) getUserContent(ctx context.Context, rec *entitys.Recognize) (content strings.Builder, err error) {
|
func (f *WithDingTalkBot) getUserContent(ctx context.Context, rec *entitys.Recognize) (content strings.Builder, err error) {
|
||||||
var hasFile bool
|
var hasFile bool
|
||||||
if rec.UserContent.File != nil && len(rec.UserContent.File) > 0 {
|
if len(rec.UserContent.File) > 0 {
|
||||||
hasFile = true
|
hasFile = true
|
||||||
}
|
}
|
||||||
content.WriteString(rec.UserContent.Text)
|
content.WriteString(rec.UserContent.Text)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue