Merge pull request '🎨 优化AI对话角色提示词' (#40) from hotfix into main
All checks were successful
BuildImage / build-image (push) Successful in 1m41s
All checks were successful
BuildImage / build-image (push) Successful in 1m41s
Reviewed-on: #40
This commit is contained in:
commit
70fc7add78
@ -35,13 +35,18 @@ func AiSummary() {
|
|||||||
// 组装对话记录为字符串
|
// 组装对话记录为字符串
|
||||||
var content []string
|
var content []string
|
||||||
for _, record := range records {
|
for _, record := range records {
|
||||||
content = append(content, fmt.Sprintf("%s: %s\n-----end-----", record.Nickname, record.Message))
|
content = append(content, fmt.Sprintf(`{"%s": "%s"}--end--`, record.Nickname, strings.ReplaceAll(record.Message, "\n", "。。")))
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := fmt.Sprintf("请帮我总结一下一下的群聊内容的梗概,生成的梗概尽可能详细,并且最好带上名字。\n"+
|
msgTmp := `请帮我总结一下一下的群聊内容的梗概,生成的梗概需要尽可能详细,需要带上一些聊天关键信息,并且带上群友名字。
|
||||||
"注意,他们可能是多个话题,请仔细甄别。\n"+
|
注意,他们可能是多个话题,请仔细甄别。
|
||||||
"每一行代表一个人的发言,每一行的的格式为: \n{nickname}: {content}\n-----end-----"+
|
每一行代表一个人的发言,每一行的的格式为: {"{nickname}": "{content}"}--end--
|
||||||
"\n\n聊天记录如下: \n%s", strings.Join(content, "\n"))
|
|
||||||
|
聊天记录如下:
|
||||||
|
%s
|
||||||
|
`
|
||||||
|
|
||||||
|
msg := fmt.Sprintf(msgTmp, strings.Join(content, "\n"))
|
||||||
|
|
||||||
// AI总结
|
// AI总结
|
||||||
messages := []openai.ChatCompletionMessage{
|
messages := []openai.ChatCompletionMessage{
|
||||||
|
Loading…
Reference in New Issue
Block a user