48
48
"- 查看AI聊天配置\n " +
49
49
"- 重置AI聊天\n " +
50
50
"- 群聊总结 [消息数目]|群聊总结 1000\n " +
51
- "- /g [内容] (使用大模型聊天)\n " ,
51
+ "- /gpt [内容] (使用大模型聊天)\n " ,
52
52
53
53
PrivateDataFolder : "aichat" ,
54
54
})
@@ -354,8 +354,8 @@ func init() {
354
354
}
355
355
356
356
// 构造总结请求提示
357
- summaryPrompt := "请总结这个群聊内容,要求按发言顺序梳理,明确标注每个发言者的昵称,并完整呈现其核心观点、提出的问题、发表的看法或做出的回应,确保不遗漏关键信息,且能体现成员间的对话逻辑和互动关系:\n \n " +
358
- strings .Join (messages , "\n --- \n " )
357
+ summaryPrompt := "请总结这个群聊内容,要求按发言顺序梳理,明确标注每个发言者的昵称,并完整呈现其核心观点、提出的问题、发表的看法或做出的回应,确保不遗漏关键信息,且能体现成员间的对话逻辑和互动关系:\n " +
358
+ strings .Join (messages , "\n " )
359
359
360
360
// 调用大模型API进行总结
361
361
summary , err := llmchat (summaryPrompt )
@@ -375,7 +375,7 @@ func init() {
375
375
b .WriteString (summary )
376
376
377
377
// 分割总结内容为多段
378
- parts := strings .Split (b .String (), "\n \n " )
378
+ parts := strings .Split (b .String (), "\n " )
379
379
msg := make (message.Message , 0 , len (parts ))
380
380
for _ , part := range parts {
381
381
if part != "" {
@@ -387,8 +387,8 @@ func init() {
387
387
}
388
388
})
389
389
390
- // 添加 /g 命令处理(同时支持回复消息和直接使用)
391
- en .OnKeyword ("/g " , ensureconfig ).SetBlock (true ).Handle (func (ctx * zero.Ctx ) {
390
+ // 添加 /gpt 命令处理(同时支持回复消息和直接使用)
391
+ en .OnKeyword ("/gpt " , ensureconfig ).SetBlock (true ).Handle (func (ctx * zero.Ctx ) {
392
392
text := ctx .MessageString ()
393
393
394
394
var query string
@@ -416,16 +416,17 @@ func init() {
416
416
}
417
417
}
418
418
419
- // 提取 /g 后面的内容
420
- parts := strings .SplitN (text , "/g" , 2 )
419
+ // 提取 /gpt 后面的内容
420
+ parts := strings .SplitN (text , "/gpt" , 2 )
421
+
421
422
var gContent string
422
423
if len (parts ) > 1 {
423
424
gContent = strings .TrimSpace (parts [1 ])
424
425
}
425
426
426
427
// 组合内容:如果有回复内容,则使用回复内容 + /g 内容;否则只使用 /g 内容
427
428
if replyContent != "" && gContent != "" {
428
- query = replyContent + "\n \n " + gContent
429
+ query = replyContent + "\n " + gContent
429
430
} else if replyContent != "" {
430
431
query = replyContent
431
432
} else if gContent != "" {
@@ -442,7 +443,7 @@ func init() {
442
443
}
443
444
444
445
// 分割内容为多段
445
- parts = strings .Split (reply , "\n \n " )
446
+ parts = strings .Split (reply , "\n " )
446
447
msg := make (message.Message , 0 , len (parts ))
447
448
for _ , part := range parts {
448
449
if part != "" {
0 commit comments