koishi-plugin-group-analysis-mx 1.7.4 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +450 -449
- package/lib/service/analysis.js +23 -8
- package/lib/service/llm.js +4 -1
- package/lib/service/renderer.js +629 -615
- package/package.json +2 -1
package/lib/config.js
CHANGED
|
@@ -1,449 +1,450 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inject = exports.name = exports.Config = void 0;
|
|
4
|
-
const koishi_1 = require("koishi");
|
|
5
|
-
const GroupListener = koishi_1.Schema.object({
|
|
6
|
-
platform: koishi_1.Schema.string().required().description('平台名称'),
|
|
7
|
-
selfId: koishi_1.Schema.string().required().description('机器人 ID'),
|
|
8
|
-
channelId: koishi_1.Schema.string().required().description('频道 ID'),
|
|
9
|
-
guildId: koishi_1.Schema.string().description('群组 ID'),
|
|
10
|
-
enabled: koishi_1.Schema.boolean().default(true).description('是否在此频道启用监听')
|
|
11
|
-
});
|
|
12
|
-
exports.Config = koishi_1.Schema.intersect([
|
|
13
|
-
koishi_1.Schema.object({
|
|
14
|
-
enableAllGroupsByDefault: koishi_1.Schema.boolean()
|
|
15
|
-
.default(false)
|
|
16
|
-
.description('为所有群默认启用群分析。开启后与 listenerGroups 不兼容(将忽略其配置);即使开启并启用数据库记录,数据库也只会记录实际触发的群消息。'),
|
|
17
|
-
listenerGroups: koishi_1.Schema.array(GroupListener)
|
|
18
|
-
.role('table')
|
|
19
|
-
.description('数据库监听规则列表。')
|
|
20
|
-
.default([]),
|
|
21
|
-
cronSchedule: koishi_1.Schema.string().description('定时发送分析报告的 CRON 表达式。留空则禁用。例如 "0 22 * * *" 表示每天22点。'),
|
|
22
|
-
autoAnalysisCooldown: koishi_1.Schema.number()
|
|
23
|
-
.min(0)
|
|
24
|
-
.max(1440)
|
|
25
|
-
.step(1)
|
|
26
|
-
.default(1)
|
|
27
|
-
.description('自动分析冷却时间(分钟)。冷却期间即使定时任务多次触发,也只会执行一次。'),
|
|
28
|
-
cronAnalysisDays: koishi_1.Schema.number()
|
|
29
|
-
.description('定时任务分析的默认天数。')
|
|
30
|
-
.default(1)
|
|
31
|
-
}).description('基础设置'),
|
|
32
|
-
koishi_1.Schema.object({
|
|
33
|
-
alwaysPersistMessages: koishi_1.Schema.boolean()
|
|
34
|
-
.description('启用后,无论平台能力如何都会将监听到的消息写入数据库。')
|
|
35
|
-
.default(false),
|
|
36
|
-
retentionDays: koishi_1.Schema.number()
|
|
37
|
-
.description('数据库中缓存消息的最长保留时间(天)。')
|
|
38
|
-
.min(1)
|
|
39
|
-
.default(7)
|
|
40
|
-
}).description('消息存储设置'),
|
|
41
|
-
koishi_1.Schema.object({
|
|
42
|
-
maxMessages: koishi_1.Schema.number()
|
|
43
|
-
.description('单次分析的最大消息数量。')
|
|
44
|
-
.default(2000),
|
|
45
|
-
minMessages: koishi_1.Schema.number()
|
|
46
|
-
.description('进行分析所需的最小消息数量。')
|
|
47
|
-
.min(10)
|
|
48
|
-
.max(1000)
|
|
49
|
-
.default(100),
|
|
50
|
-
maxUsersInReport: koishi_1.Schema.number()
|
|
51
|
-
.description('报告中显示的最大活跃用户数量。')
|
|
52
|
-
.default(10),
|
|
53
|
-
userTitleAnalysis: koishi_1.Schema.boolean()
|
|
54
|
-
.description('是否启用用户称号分析(需要消耗更多 Token)。')
|
|
55
|
-
.default(true),
|
|
56
|
-
groupAnalysisCacheMinutes: koishi_1.Schema.number()
|
|
57
|
-
.description('群分析缓存结果的保留分钟数。超过此时长后会重新分析。')
|
|
58
|
-
.min(0)
|
|
59
|
-
.default(5),
|
|
60
|
-
wordsFilter: koishi_1.Schema.array(String)
|
|
61
|
-
.role('table')
|
|
62
|
-
.description('过滤词列表。消息内含有此词语时将不会记入统计消息。')
|
|
63
|
-
.default([]),
|
|
64
|
-
userFilter: koishi_1.Schema.array(String)
|
|
65
|
-
.role('table')
|
|
66
|
-
.description('用户过滤列表。在群分析中忽略这些用户 ID 的消息。')
|
|
67
|
-
.default([]),
|
|
68
|
-
maxTopics: koishi_1.Schema.number()
|
|
69
|
-
.description('最多生成的话题数量。')
|
|
70
|
-
.default(5),
|
|
71
|
-
maxUserTitles: koishi_1.Schema.number()
|
|
72
|
-
.description('最多生成的用户称号数量。')
|
|
73
|
-
.default(6),
|
|
74
|
-
maxGoldenQuotes: koishi_1.Schema.number()
|
|
75
|
-
.description('最多生成的金句数量。')
|
|
76
|
-
.default(3)
|
|
77
|
-
}).description('群分析设置'),
|
|
78
|
-
koishi_1.Schema.object({
|
|
79
|
-
outputFormat: koishi_1.Schema.union([
|
|
80
|
-
koishi_1.Schema.const('image').description('图片'),
|
|
81
|
-
koishi_1.Schema.const('pdf').description('PDF'),
|
|
82
|
-
koishi_1.Schema.const('text').description('文本')
|
|
83
|
-
])
|
|
84
|
-
.description('默认输出格式。')
|
|
85
|
-
.default('image'),
|
|
86
|
-
theme: koishi_1.Schema.union([
|
|
87
|
-
koishi_1.Schema.const('light').description('亮色主题'),
|
|
88
|
-
koishi_1.Schema.const('dark').description('暗色主题'),
|
|
89
|
-
koishi_1.Schema.const('auto').description('自动模式')
|
|
90
|
-
])
|
|
91
|
-
.description('渲染模板的主题。auto 会在 19:00-06:00 期间自动切换到暗色模式。')
|
|
92
|
-
.default('auto'),
|
|
93
|
-
skin: koishi_1.Schema.union([
|
|
94
|
-
koishi_1.Schema.const('md3').description('Material Design 3'),
|
|
95
|
-
koishi_1.Schema.const('anime').description('二次元风格'),
|
|
96
|
-
koishi_1.Schema.const('newspaper').description('报纸风格'),
|
|
97
|
-
koishi_1.Schema.const('art').description('艺术风格'),
|
|
98
|
-
koishi_1.Schema.const('scrapbook').description('手账风格'),
|
|
99
|
-
koishi_1.Schema.const('atri').description('ATRI(原项目皮肤)'),
|
|
100
|
-
koishi_1.Schema.const('hatsunemiku').description('初音未来(原项目皮肤)'),
|
|
101
|
-
koishi_1.Schema.const('bluearchive').description('蔚蓝档案(原项目皮肤)'),
|
|
102
|
-
koishi_1.Schema.const('springfestival').description('新春(原项目皮肤)'),
|
|
103
|
-
koishi_1.Schema.const('retrofuturism').description('复古未来(原项目皮肤)'),
|
|
104
|
-
koishi_1.Schema.const('hack').description('黑客终端(原项目皮肤)'),
|
|
105
|
-
koishi_1.Schema.const('format').description('简约排版(原项目皮肤)'),
|
|
106
|
-
koishi_1.Schema.const('simple').description('极简(原项目皮肤)')
|
|
107
|
-
])
|
|
108
|
-
.description('渲染界面皮肤。')
|
|
109
|
-
.default('md3')
|
|
110
|
-
}).description('分析渲染设置'),
|
|
111
|
-
koishi_1.Schema.object({
|
|
112
|
-
openaiEndpoint: koishi_1.Schema.string()
|
|
113
|
-
.description('OpenAI 兼容 API 地址。')
|
|
114
|
-
.default('https://api.openai.com/v1'),
|
|
115
|
-
openaiApiKey: koishi_1.Schema.string()
|
|
116
|
-
.role('secret')
|
|
117
|
-
.description('OpenAI API Key(支持任意兼容 OpenAI 接口的厂商)。'),
|
|
118
|
-
openaiModel: koishi_1.Schema.string()
|
|
119
|
-
.description('使用的模型名称。')
|
|
120
|
-
.default('gpt-4o'),
|
|
121
|
-
temperature: koishi_1.Schema.number()
|
|
122
|
-
.description('生成的温度。')
|
|
123
|
-
.min(0)
|
|
124
|
-
.max(2)
|
|
125
|
-
.default(1.5)
|
|
126
|
-
}).description('OpenAI API 设置'),
|
|
127
|
-
koishi_1.Schema.object({
|
|
128
|
-
enableDailyComic: koishi_1.Schema.boolean()
|
|
129
|
-
.description('是否启用每日漫画功能。')
|
|
130
|
-
.default(false),
|
|
131
|
-
comicSchedule: koishi_1.Schema.string()
|
|
132
|
-
.description('每日漫画自动生成的 CRON 表达式。留空则仅手动触发。例如 "0 20 * * *" 表示每天 20:00。')
|
|
133
|
-
.default(''),
|
|
134
|
-
comicDays: koishi_1.Schema.number()
|
|
135
|
-
.description('漫画话题分析回溯的天数。')
|
|
136
|
-
.min(1)
|
|
137
|
-
.max(7)
|
|
138
|
-
.default(1),
|
|
139
|
-
comicMinMessages: koishi_1.Schema.number()
|
|
140
|
-
.description('生成漫画所需的最小消息数量。')
|
|
141
|
-
.min(10)
|
|
142
|
-
.default(50),
|
|
143
|
-
promptComicStoryboard: koishi_1.Schema.string()
|
|
144
|
-
.description('漫画分镜提示词模板。')
|
|
145
|
-
.role('textarea')
|
|
146
|
-
.default(`你是一个资深的漫画分镜师与 AI 绘画提示词专家。请根据以下【群聊每日核心话题列表】,将其改编并设计为一个精彩的多格连环漫画(Comic Strip)全景视觉画图提示词 (Prompt)。
|
|
147
|
-
|
|
148
|
-
【核心规则】:
|
|
149
|
-
1. 每个话题对应一个分格 Panel(共 {topicCount} 个分格),不许遗漏任何话题。
|
|
150
|
-
2. 为每个话题设计一句生动的人物台词或吐槽(控制在 15 个汉字以内),放在角色气泡中(adorable kawaii anime speech bubble, soft rounded cloud-like shape, cute pointer tail pointing to the speaker)。
|
|
151
|
-
3. 每个分格底部设计一条精炼的事件旁白条(控制在 30 字以内,cute pastel-colored kawaii caption strip at the bottom of the panel with soft rounded corners,严禁死板白框)。
|
|
152
|
-
4. 气泡与旁白条内的中文必须显式渲染(指令格式:containing a speech bubble with exact Chinese text "台词" 以及 and a cute caption strip at bottom with exact Chinese text "短标题"),绝对禁止将中文翻译成英文。
|
|
153
|
-
5. 画面整体构图与场景描述使用英文;严禁将长篇上下文写在画面上,仅允许渲染短标题字幕条和气泡台词。
|
|
154
|
-
6. 保持整篇连环画的主角(一个可爱的动漫少女角色)绝对连贯,每个分格都必须出现。
|
|
155
|
-
|
|
156
|
-
【待创作的群聊核心话题列表】:
|
|
157
|
-
{topics}
|
|
158
|
-
|
|
159
|
-
请输出包含 "scene" 字段的 JSON 对象,scene 为完整的英文生图提示词。`)
|
|
160
|
-
}).description('每日漫画设置'),
|
|
161
|
-
koishi_1.Schema.object({
|
|
162
|
-
drawingEndpoint: koishi_1.Schema.string()
|
|
163
|
-
.description('OpenAI 兼容的生图 API 地址(末尾无需 /v1)。支持 OpenAI、SiliconFlow、豆包/火山方舟等。')
|
|
164
|
-
.default(''),
|
|
165
|
-
drawingApiKey: koishi_1.Schema.string()
|
|
166
|
-
.role('secret')
|
|
167
|
-
.description('生图 API Key。'),
|
|
168
|
-
drawingModel: koishi_1.Schema.string()
|
|
169
|
-
.description('生图模型名称,例如 gpt-image-1、dall-e-3、Kolors 等。')
|
|
170
|
-
.default('gpt-image-1'),
|
|
171
|
-
drawingSize: koishi_1.Schema.string()
|
|
172
|
-
.description('生图尺寸。')
|
|
173
|
-
.default('1024x1024')
|
|
174
|
-
}).description('生图 API 设置'),
|
|
175
|
-
koishi_1.Schema.object({
|
|
176
|
-
personaUserFilter: koishi_1.Schema.array(String)
|
|
177
|
-
.role('table')
|
|
178
|
-
.description('用户画像过滤列表。这些用户 ID 将无法分析用户画像(包括自动分析和手动命令调用)。')
|
|
179
|
-
.default([]),
|
|
180
|
-
personaAnalysisMessageInterval: koishi_1.Schema.number()
|
|
181
|
-
.description('跨群用户画像分析的触发阈值,新消息累计达到该条数时尝试更新画像。设置为 0 则关闭自动画像分析。')
|
|
182
|
-
.min(0)
|
|
183
|
-
.default(50),
|
|
184
|
-
personaCacheLifetimeDays: koishi_1.Schema.number()
|
|
185
|
-
.description('用户画像缓存结果的保留天数。超过此时长后再次请求会重新生成画像。')
|
|
186
|
-
.min(0)
|
|
187
|
-
.default(3),
|
|
188
|
-
personaLookbackDays: koishi_1.Schema.number()
|
|
189
|
-
.description('画像分析回溯的天数窗口(建议保持在 1-4 天)。')
|
|
190
|
-
.min(1)
|
|
191
|
-
.max(7)
|
|
192
|
-
.default(2),
|
|
193
|
-
personaMaxMessages: koishi_1.Schema.number()
|
|
194
|
-
.description('单次用户画像分析最多提取的历史消息数量。')
|
|
195
|
-
.min(100)
|
|
196
|
-
.max(1500)
|
|
197
|
-
.default(400),
|
|
198
|
-
personaMinMessages: koishi_1.Schema.number()
|
|
199
|
-
.description('触发用户画像分析所需的最少历史消息数量。')
|
|
200
|
-
.min(10)
|
|
201
|
-
.default(20),
|
|
202
|
-
personaViewAuthority: koishi_1.Schema.number()
|
|
203
|
-
.description('查看他人用户画像所需的最低权限等级(0=所有人, 1=用户, 2=协管, 3=管理员, 4=主人)。')
|
|
204
|
-
.min(0)
|
|
205
|
-
.max(4)
|
|
206
|
-
.step(1)
|
|
207
|
-
.default(3),
|
|
208
|
-
personaOnlyCurrentGroup: koishi_1.Schema.boolean()
|
|
209
|
-
.description('用户画像是否只统计当前群内容。开启后仅分析触发群的消息,关闭则汇总所有监听群的消息。')
|
|
210
|
-
.default(false),
|
|
211
|
-
personaWhitelist: koishi_1.Schema.array(String)
|
|
212
|
-
.role('table')
|
|
213
|
-
.description('特权用户 ID。特权用户可查看他人画像且不受权限限制,同时其他人无法查看特权用户的画像。')
|
|
214
|
-
.default([]),
|
|
215
|
-
personaBlacklist: koishi_1.Schema.array(String)
|
|
216
|
-
.role('table')
|
|
217
|
-
.description('黑名单用户 ID。黑名单用户无法使用用户画像和群分析命令。')
|
|
218
|
-
.default([])
|
|
219
|
-
}).description('用户画像设置'),
|
|
220
|
-
koishi_1.Schema.object({
|
|
221
|
-
promptTopic: koishi_1.Schema.string()
|
|
222
|
-
.description('话题分析的提示词模板。')
|
|
223
|
-
.role('textarea')
|
|
224
|
-
.default(`你是一个帮我进行群聊信息总结的助手,生成总结内容时,你需要严格遵守下面的几个准则:
|
|
225
|
-
请分析接下来提供的群聊记录,提取出最多{maxTopics}个主要话题。根据你自己的价值观判断需要的主要话题。越逆天越好。
|
|
226
|
-
|
|
227
|
-
对于每个话题,请提供:
|
|
228
|
-
1. 话题名称(突出主题内容,尽量简明扼要)
|
|
229
|
-
2.
|
|
230
|
-
3. 话题详细描述(包含关键信息和结论)
|
|
231
|
-
|
|
232
|
-
注意:
|
|
233
|
-
- 对于比较有价值的点,稍微用一两句话详细讲讲,比如不要生成 "Nolan 和 SOV 讨论了 galgame 中关于性符号的衍生情况" 这种宽泛的内容,而是生成更加具体的讨论内容,让其他人只看这个消息就能知道讨论中有价值的,有营养的信息。
|
|
234
|
-
- 对于其中的部分信息,你需要特意提到主题施加的主体是谁,是哪个群友做了什么事情,而不要直接生成和群友没有关系的语句。
|
|
235
|
-
- 对于每一条总结,尽量讲清楚前因后果,以及话题的结论,是什么,为什么,怎么做,如果用户没有讲到细节,则可以不用这么做。
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
用户查询:{query}
|
|
239
|
-
用户关注关键词:{keywords}
|
|
240
|
-
用户关注话题:{topics}
|
|
241
|
-
用户关注昵称:{nicknames}
|
|
242
|
-
目标时间范围:{timeRange}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
.
|
|
262
|
-
.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
.
|
|
298
|
-
.
|
|
299
|
-
|
|
300
|
-
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
.
|
|
333
|
-
.
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
.
|
|
366
|
-
.
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
-
|
|
371
|
-
-
|
|
372
|
-
-
|
|
373
|
-
-
|
|
374
|
-
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
- "
|
|
384
|
-
- "
|
|
385
|
-
- "
|
|
386
|
-
- "
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
- "
|
|
392
|
-
- "xx
|
|
393
|
-
- "
|
|
394
|
-
- "
|
|
395
|
-
- "
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
- "
|
|
401
|
-
- "
|
|
402
|
-
- "
|
|
403
|
-
- "
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
.
|
|
427
|
-
.
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
-
|
|
432
|
-
-
|
|
433
|
-
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
exports.
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inject = exports.name = exports.Config = void 0;
|
|
4
|
+
const koishi_1 = require("koishi");
|
|
5
|
+
const GroupListener = koishi_1.Schema.object({
|
|
6
|
+
platform: koishi_1.Schema.string().required().description('平台名称'),
|
|
7
|
+
selfId: koishi_1.Schema.string().required().description('机器人 ID'),
|
|
8
|
+
channelId: koishi_1.Schema.string().required().description('频道 ID'),
|
|
9
|
+
guildId: koishi_1.Schema.string().description('群组 ID'),
|
|
10
|
+
enabled: koishi_1.Schema.boolean().default(true).description('是否在此频道启用监听')
|
|
11
|
+
});
|
|
12
|
+
exports.Config = koishi_1.Schema.intersect([
|
|
13
|
+
koishi_1.Schema.object({
|
|
14
|
+
enableAllGroupsByDefault: koishi_1.Schema.boolean()
|
|
15
|
+
.default(false)
|
|
16
|
+
.description('为所有群默认启用群分析。开启后与 listenerGroups 不兼容(将忽略其配置);即使开启并启用数据库记录,数据库也只会记录实际触发的群消息。'),
|
|
17
|
+
listenerGroups: koishi_1.Schema.array(GroupListener)
|
|
18
|
+
.role('table')
|
|
19
|
+
.description('数据库监听规则列表。')
|
|
20
|
+
.default([]),
|
|
21
|
+
cronSchedule: koishi_1.Schema.string().description('定时发送分析报告的 CRON 表达式。留空则禁用。例如 "0 22 * * *" 表示每天22点。'),
|
|
22
|
+
autoAnalysisCooldown: koishi_1.Schema.number()
|
|
23
|
+
.min(0)
|
|
24
|
+
.max(1440)
|
|
25
|
+
.step(1)
|
|
26
|
+
.default(1)
|
|
27
|
+
.description('自动分析冷却时间(分钟)。冷却期间即使定时任务多次触发,也只会执行一次。'),
|
|
28
|
+
cronAnalysisDays: koishi_1.Schema.number()
|
|
29
|
+
.description('定时任务分析的默认天数。')
|
|
30
|
+
.default(1)
|
|
31
|
+
}).description('基础设置'),
|
|
32
|
+
koishi_1.Schema.object({
|
|
33
|
+
alwaysPersistMessages: koishi_1.Schema.boolean()
|
|
34
|
+
.description('启用后,无论平台能力如何都会将监听到的消息写入数据库。')
|
|
35
|
+
.default(false),
|
|
36
|
+
retentionDays: koishi_1.Schema.number()
|
|
37
|
+
.description('数据库中缓存消息的最长保留时间(天)。')
|
|
38
|
+
.min(1)
|
|
39
|
+
.default(7)
|
|
40
|
+
}).description('消息存储设置'),
|
|
41
|
+
koishi_1.Schema.object({
|
|
42
|
+
maxMessages: koishi_1.Schema.number()
|
|
43
|
+
.description('单次分析的最大消息数量。')
|
|
44
|
+
.default(2000),
|
|
45
|
+
minMessages: koishi_1.Schema.number()
|
|
46
|
+
.description('进行分析所需的最小消息数量。')
|
|
47
|
+
.min(10)
|
|
48
|
+
.max(1000)
|
|
49
|
+
.default(100),
|
|
50
|
+
maxUsersInReport: koishi_1.Schema.number()
|
|
51
|
+
.description('报告中显示的最大活跃用户数量。')
|
|
52
|
+
.default(10),
|
|
53
|
+
userTitleAnalysis: koishi_1.Schema.boolean()
|
|
54
|
+
.description('是否启用用户称号分析(需要消耗更多 Token)。')
|
|
55
|
+
.default(true),
|
|
56
|
+
groupAnalysisCacheMinutes: koishi_1.Schema.number()
|
|
57
|
+
.description('群分析缓存结果的保留分钟数。超过此时长后会重新分析。')
|
|
58
|
+
.min(0)
|
|
59
|
+
.default(5),
|
|
60
|
+
wordsFilter: koishi_1.Schema.array(String)
|
|
61
|
+
.role('table')
|
|
62
|
+
.description('过滤词列表。消息内含有此词语时将不会记入统计消息。')
|
|
63
|
+
.default([]),
|
|
64
|
+
userFilter: koishi_1.Schema.array(String)
|
|
65
|
+
.role('table')
|
|
66
|
+
.description('用户过滤列表。在群分析中忽略这些用户 ID 的消息。')
|
|
67
|
+
.default([]),
|
|
68
|
+
maxTopics: koishi_1.Schema.number()
|
|
69
|
+
.description('最多生成的话题数量。')
|
|
70
|
+
.default(5),
|
|
71
|
+
maxUserTitles: koishi_1.Schema.number()
|
|
72
|
+
.description('最多生成的用户称号数量。')
|
|
73
|
+
.default(6),
|
|
74
|
+
maxGoldenQuotes: koishi_1.Schema.number()
|
|
75
|
+
.description('最多生成的金句数量。')
|
|
76
|
+
.default(3)
|
|
77
|
+
}).description('群分析设置'),
|
|
78
|
+
koishi_1.Schema.object({
|
|
79
|
+
outputFormat: koishi_1.Schema.union([
|
|
80
|
+
koishi_1.Schema.const('image').description('图片'),
|
|
81
|
+
koishi_1.Schema.const('pdf').description('PDF'),
|
|
82
|
+
koishi_1.Schema.const('text').description('文本')
|
|
83
|
+
])
|
|
84
|
+
.description('默认输出格式。')
|
|
85
|
+
.default('image'),
|
|
86
|
+
theme: koishi_1.Schema.union([
|
|
87
|
+
koishi_1.Schema.const('light').description('亮色主题'),
|
|
88
|
+
koishi_1.Schema.const('dark').description('暗色主题'),
|
|
89
|
+
koishi_1.Schema.const('auto').description('自动模式')
|
|
90
|
+
])
|
|
91
|
+
.description('渲染模板的主题。auto 会在 19:00-06:00 期间自动切换到暗色模式。')
|
|
92
|
+
.default('auto'),
|
|
93
|
+
skin: koishi_1.Schema.union([
|
|
94
|
+
koishi_1.Schema.const('md3').description('Material Design 3'),
|
|
95
|
+
koishi_1.Schema.const('anime').description('二次元风格'),
|
|
96
|
+
koishi_1.Schema.const('newspaper').description('报纸风格'),
|
|
97
|
+
koishi_1.Schema.const('art').description('艺术风格'),
|
|
98
|
+
koishi_1.Schema.const('scrapbook').description('手账风格'),
|
|
99
|
+
koishi_1.Schema.const('atri').description('ATRI(原项目皮肤)'),
|
|
100
|
+
koishi_1.Schema.const('hatsunemiku').description('初音未来(原项目皮肤)'),
|
|
101
|
+
koishi_1.Schema.const('bluearchive').description('蔚蓝档案(原项目皮肤)'),
|
|
102
|
+
koishi_1.Schema.const('springfestival').description('新春(原项目皮肤)'),
|
|
103
|
+
koishi_1.Schema.const('retrofuturism').description('复古未来(原项目皮肤)'),
|
|
104
|
+
koishi_1.Schema.const('hack').description('黑客终端(原项目皮肤)'),
|
|
105
|
+
koishi_1.Schema.const('format').description('简约排版(原项目皮肤)'),
|
|
106
|
+
koishi_1.Schema.const('simple').description('极简(原项目皮肤)')
|
|
107
|
+
])
|
|
108
|
+
.description('渲染界面皮肤。')
|
|
109
|
+
.default('md3')
|
|
110
|
+
}).description('分析渲染设置'),
|
|
111
|
+
koishi_1.Schema.object({
|
|
112
|
+
openaiEndpoint: koishi_1.Schema.string()
|
|
113
|
+
.description('OpenAI 兼容 API 地址。')
|
|
114
|
+
.default('https://api.openai.com/v1'),
|
|
115
|
+
openaiApiKey: koishi_1.Schema.string()
|
|
116
|
+
.role('secret')
|
|
117
|
+
.description('OpenAI API Key(支持任意兼容 OpenAI 接口的厂商)。'),
|
|
118
|
+
openaiModel: koishi_1.Schema.string()
|
|
119
|
+
.description('使用的模型名称。')
|
|
120
|
+
.default('gpt-4o'),
|
|
121
|
+
temperature: koishi_1.Schema.number()
|
|
122
|
+
.description('生成的温度。')
|
|
123
|
+
.min(0)
|
|
124
|
+
.max(2)
|
|
125
|
+
.default(1.5)
|
|
126
|
+
}).description('OpenAI API 设置'),
|
|
127
|
+
koishi_1.Schema.object({
|
|
128
|
+
enableDailyComic: koishi_1.Schema.boolean()
|
|
129
|
+
.description('是否启用每日漫画功能。')
|
|
130
|
+
.default(false),
|
|
131
|
+
comicSchedule: koishi_1.Schema.string()
|
|
132
|
+
.description('每日漫画自动生成的 CRON 表达式。留空则仅手动触发。例如 "0 20 * * *" 表示每天 20:00。')
|
|
133
|
+
.default(''),
|
|
134
|
+
comicDays: koishi_1.Schema.number()
|
|
135
|
+
.description('漫画话题分析回溯的天数。')
|
|
136
|
+
.min(1)
|
|
137
|
+
.max(7)
|
|
138
|
+
.default(1),
|
|
139
|
+
comicMinMessages: koishi_1.Schema.number()
|
|
140
|
+
.description('生成漫画所需的最小消息数量。')
|
|
141
|
+
.min(10)
|
|
142
|
+
.default(50),
|
|
143
|
+
promptComicStoryboard: koishi_1.Schema.string()
|
|
144
|
+
.description('漫画分镜提示词模板。')
|
|
145
|
+
.role('textarea')
|
|
146
|
+
.default(`你是一个资深的漫画分镜师与 AI 绘画提示词专家。请根据以下【群聊每日核心话题列表】,将其改编并设计为一个精彩的多格连环漫画(Comic Strip)全景视觉画图提示词 (Prompt)。
|
|
147
|
+
|
|
148
|
+
【核心规则】:
|
|
149
|
+
1. 每个话题对应一个分格 Panel(共 {topicCount} 个分格),不许遗漏任何话题。
|
|
150
|
+
2. 为每个话题设计一句生动的人物台词或吐槽(控制在 15 个汉字以内),放在角色气泡中(adorable kawaii anime speech bubble, soft rounded cloud-like shape, cute pointer tail pointing to the speaker)。
|
|
151
|
+
3. 每个分格底部设计一条精炼的事件旁白条(控制在 30 字以内,cute pastel-colored kawaii caption strip at the bottom of the panel with soft rounded corners,严禁死板白框)。
|
|
152
|
+
4. 气泡与旁白条内的中文必须显式渲染(指令格式:containing a speech bubble with exact Chinese text "台词" 以及 and a cute caption strip at bottom with exact Chinese text "短标题"),绝对禁止将中文翻译成英文。
|
|
153
|
+
5. 画面整体构图与场景描述使用英文;严禁将长篇上下文写在画面上,仅允许渲染短标题字幕条和气泡台词。
|
|
154
|
+
6. 保持整篇连环画的主角(一个可爱的动漫少女角色)绝对连贯,每个分格都必须出现。
|
|
155
|
+
|
|
156
|
+
【待创作的群聊核心话题列表】:
|
|
157
|
+
{topics}
|
|
158
|
+
|
|
159
|
+
请输出包含 "scene" 字段的 JSON 对象,scene 为完整的英文生图提示词。`)
|
|
160
|
+
}).description('每日漫画设置'),
|
|
161
|
+
koishi_1.Schema.object({
|
|
162
|
+
drawingEndpoint: koishi_1.Schema.string()
|
|
163
|
+
.description('OpenAI 兼容的生图 API 地址(末尾无需 /v1)。支持 OpenAI、SiliconFlow、豆包/火山方舟等。')
|
|
164
|
+
.default(''),
|
|
165
|
+
drawingApiKey: koishi_1.Schema.string()
|
|
166
|
+
.role('secret')
|
|
167
|
+
.description('生图 API Key。'),
|
|
168
|
+
drawingModel: koishi_1.Schema.string()
|
|
169
|
+
.description('生图模型名称,例如 gpt-image-1、dall-e-3、Kolors 等。')
|
|
170
|
+
.default('gpt-image-1'),
|
|
171
|
+
drawingSize: koishi_1.Schema.string()
|
|
172
|
+
.description('生图尺寸。')
|
|
173
|
+
.default('1024x1024')
|
|
174
|
+
}).description('生图 API 设置'),
|
|
175
|
+
koishi_1.Schema.object({
|
|
176
|
+
personaUserFilter: koishi_1.Schema.array(String)
|
|
177
|
+
.role('table')
|
|
178
|
+
.description('用户画像过滤列表。这些用户 ID 将无法分析用户画像(包括自动分析和手动命令调用)。')
|
|
179
|
+
.default([]),
|
|
180
|
+
personaAnalysisMessageInterval: koishi_1.Schema.number()
|
|
181
|
+
.description('跨群用户画像分析的触发阈值,新消息累计达到该条数时尝试更新画像。设置为 0 则关闭自动画像分析。')
|
|
182
|
+
.min(0)
|
|
183
|
+
.default(50),
|
|
184
|
+
personaCacheLifetimeDays: koishi_1.Schema.number()
|
|
185
|
+
.description('用户画像缓存结果的保留天数。超过此时长后再次请求会重新生成画像。')
|
|
186
|
+
.min(0)
|
|
187
|
+
.default(3),
|
|
188
|
+
personaLookbackDays: koishi_1.Schema.number()
|
|
189
|
+
.description('画像分析回溯的天数窗口(建议保持在 1-4 天)。')
|
|
190
|
+
.min(1)
|
|
191
|
+
.max(7)
|
|
192
|
+
.default(2),
|
|
193
|
+
personaMaxMessages: koishi_1.Schema.number()
|
|
194
|
+
.description('单次用户画像分析最多提取的历史消息数量。')
|
|
195
|
+
.min(100)
|
|
196
|
+
.max(1500)
|
|
197
|
+
.default(400),
|
|
198
|
+
personaMinMessages: koishi_1.Schema.number()
|
|
199
|
+
.description('触发用户画像分析所需的最少历史消息数量。')
|
|
200
|
+
.min(10)
|
|
201
|
+
.default(20),
|
|
202
|
+
personaViewAuthority: koishi_1.Schema.number()
|
|
203
|
+
.description('查看他人用户画像所需的最低权限等级(0=所有人, 1=用户, 2=协管, 3=管理员, 4=主人)。')
|
|
204
|
+
.min(0)
|
|
205
|
+
.max(4)
|
|
206
|
+
.step(1)
|
|
207
|
+
.default(3),
|
|
208
|
+
personaOnlyCurrentGroup: koishi_1.Schema.boolean()
|
|
209
|
+
.description('用户画像是否只统计当前群内容。开启后仅分析触发群的消息,关闭则汇总所有监听群的消息。')
|
|
210
|
+
.default(false),
|
|
211
|
+
personaWhitelist: koishi_1.Schema.array(String)
|
|
212
|
+
.role('table')
|
|
213
|
+
.description('特权用户 ID。特权用户可查看他人画像且不受权限限制,同时其他人无法查看特权用户的画像。')
|
|
214
|
+
.default([]),
|
|
215
|
+
personaBlacklist: koishi_1.Schema.array(String)
|
|
216
|
+
.role('table')
|
|
217
|
+
.description('黑名单用户 ID。黑名单用户无法使用用户画像和群分析命令。')
|
|
218
|
+
.default([])
|
|
219
|
+
}).description('用户画像设置'),
|
|
220
|
+
koishi_1.Schema.object({
|
|
221
|
+
promptTopic: koishi_1.Schema.string()
|
|
222
|
+
.description('话题分析的提示词模板。')
|
|
223
|
+
.role('textarea')
|
|
224
|
+
.default(`你是一个帮我进行群聊信息总结的助手,生成总结内容时,你需要严格遵守下面的几个准则:
|
|
225
|
+
请分析接下来提供的群聊记录,提取出最多{maxTopics}个主要话题。根据你自己的价值观判断需要的主要话题。越逆天越好。
|
|
226
|
+
|
|
227
|
+
对于每个话题,请提供:
|
|
228
|
+
1. 话题名称(突出主题内容,尽量简明扼要)
|
|
229
|
+
2. 主要参与者的原始用户 ID(最多5人;必须逐字取自消息记录中的用户 ID)
|
|
230
|
+
3. 话题详细描述(包含关键信息和结论)
|
|
231
|
+
|
|
232
|
+
注意:
|
|
233
|
+
- 对于比较有价值的点,稍微用一两句话详细讲讲,比如不要生成 "Nolan 和 SOV 讨论了 galgame 中关于性符号的衍生情况" 这种宽泛的内容,而是生成更加具体的讨论内容,让其他人只看这个消息就能知道讨论中有价值的,有营养的信息。
|
|
234
|
+
- 对于其中的部分信息,你需要特意提到主题施加的主体是谁,是哪个群友做了什么事情,而不要直接生成和群友没有关系的语句。
|
|
235
|
+
- 对于每一条总结,尽量讲清楚前因后果,以及话题的结论,是什么,为什么,怎么做,如果用户没有讲到细节,则可以不用这么做。
|
|
236
|
+
- 对于话题描述中的具体群友,使用 [user_id] 格式引用,不要裸写 ID。
|
|
237
|
+
|
|
238
|
+
用户查询:{query}
|
|
239
|
+
用户关注关键词:{keywords}
|
|
240
|
+
用户关注话题:{topics}
|
|
241
|
+
用户关注昵称:{nicknames}
|
|
242
|
+
目标时间范围:{timeRange}
|
|
243
|
+
|
|
244
|
+
要求:生成内容时需优先围绕上述关键词、话题、昵称与时间范围。
|
|
245
|
+
- contributors 必须逐字输出群聊记录行首方括号中的原始 user_id(输入格式为 [user_id]: 消息内容),不得输出昵称、昵称和 ID 的拼接或其他标记。
|
|
246
|
+
- 在 detail 中提及具体群友时,只用 [user_id] 格式引用,例如 [A1B2C3D4E5F6A1B2C3D4E5F6A1B2C3D4];不要把 ID 裸写,也不要只写昵称。
|
|
247
|
+
|
|
248
|
+
群聊记录:
|
|
249
|
+
{messages}
|
|
250
|
+
|
|
251
|
+
请严格按照以下 YAML 格式返回,放在 markdown 代码块中:
|
|
252
|
+
\`\`\`yaml
|
|
253
|
+
- topic: "话题名称"
|
|
254
|
+
contributors:
|
|
255
|
+
- "3802521732"
|
|
256
|
+
- "064E9FDB29191628CCA5F2631A111C2F"
|
|
257
|
+
detail: |-
|
|
258
|
+
群友 [3802521732] 提出观点,[064E9FDB29191628CCA5F2631A111C2F] 随后补充了相关经历。
|
|
259
|
+
\`\`\``),
|
|
260
|
+
promptUserTitles: koishi_1.Schema.string()
|
|
261
|
+
.description('用户称号分析的提示词模板。')
|
|
262
|
+
.role('textarea')
|
|
263
|
+
.default(`请为以下群友分配合适的称号和MBTI类型。每个人只能有一个称号,每个称号只能给一个人。
|
|
264
|
+
|
|
265
|
+
可选称号:
|
|
266
|
+
- 龙王: 发言频繁但内容轻松的人
|
|
267
|
+
- 技术专家: 经常讨论技术话题的人
|
|
268
|
+
- 夜猫子: 经常在深夜发言的人
|
|
269
|
+
- 表情包军火库: 经常发表情的人
|
|
270
|
+
- 沉默终结者: 经常开启话题的人
|
|
271
|
+
- 评论家: 平均发言长度很长的人
|
|
272
|
+
- 阳角: 在群里很有影响力的人
|
|
273
|
+
- 互动达人: 经常回复别人的人
|
|
274
|
+
- ... (你可以自行进行拓展添加)
|
|
275
|
+
|
|
276
|
+
用户查询:{query}
|
|
277
|
+
用户关注关键词:{keywords}
|
|
278
|
+
用户关注话题:{topics}
|
|
279
|
+
用户关注昵称:{nicknames}
|
|
280
|
+
目标时间范围:{timeRange}
|
|
281
|
+
|
|
282
|
+
要求:生成内容时需优先围绕上述关键词、话题、昵称与时间范围;不相关的用户不要入选。如果为空的,请忽略。
|
|
283
|
+
|
|
284
|
+
用户数据:
|
|
285
|
+
{users}
|
|
286
|
+
|
|
287
|
+
请严格按照以下 YAML 格式返回,放在 markdown 代码块中:
|
|
288
|
+
\`\`\`yaml
|
|
289
|
+
- name: "用户名"
|
|
290
|
+
id: 123456789
|
|
291
|
+
title: "称号"
|
|
292
|
+
mbti: "MBTI类型"
|
|
293
|
+
reason: |-
|
|
294
|
+
获得此称号的原因(支持多行文本,不要在里面添加任何markdown语法,请使用纯文本)
|
|
295
|
+
\`\`\``),
|
|
296
|
+
promptGoldenQuotes: koishi_1.Schema.string()
|
|
297
|
+
.description('金句分析的提示词模板。')
|
|
298
|
+
.role('textarea')
|
|
299
|
+
.default(`请从以下群聊记录中挑选出{maxGoldenQuotes}句最具冲击力、最令人惊叹的"金句"。这些金句需满足:
|
|
300
|
+
- 核心标准:**逆天的神人发言**,即具备颠覆常识的脑洞、逻辑跳脱的表达或强烈反差感的原创内容
|
|
301
|
+
- 典型特征:包含某些争议话题元素、夸张类比、反常规结论、一本正经的"胡说八道"或突破语境的清奇思路,并且具备一定的冲击力,让人印象深刻。
|
|
302
|
+
|
|
303
|
+
对于每个金句,请提供:
|
|
304
|
+
1. 原文内容(完整保留发言细节)
|
|
305
|
+
2. 发送者标识(群聊记录中对应的 [user_id],原样复述)
|
|
306
|
+
3. 选择理由(具体说明其"逆天"之处,如逻辑颠覆点/脑洞角度/反差感/争议话题元素)
|
|
307
|
+
|
|
308
|
+
此外,我将对你进行严格约束:
|
|
309
|
+
- 优先筛选 **逆天指数最高** 的内容:发情、性压抑话题 > 争议话题 > 元素级 > 颠覆认知级 > 逻辑跳脱级 > 趣味调侃级,剔除单纯玩梗或网络热词堆砌的普通发言
|
|
310
|
+
- 重点标记包含极端类比、反常识论证或无厘头结论的内容,并且包含一定的争议话题元素。
|
|
311
|
+
|
|
312
|
+
用户查询:{query}
|
|
313
|
+
用户关注关键词:{keywords}
|
|
314
|
+
用户关注话题:{topics}
|
|
315
|
+
用户关注昵称:{nicknames}
|
|
316
|
+
目标时间范围:{timeRange}
|
|
317
|
+
|
|
318
|
+
要求:生成内容时需优先围绕上述关键词、话题、昵称与时间范围;不相关的金句请过滤。如果为空的,请忽略。
|
|
319
|
+
|
|
320
|
+
群聊记录(每条消息的发送者用 [user_id] 标识,不含昵称):
|
|
321
|
+
{messages}
|
|
322
|
+
|
|
323
|
+
请严格按照以下 YAML 格式返回,放在 markdown 代码块中:
|
|
324
|
+
\`\`\`yaml
|
|
325
|
+
- content: |-
|
|
326
|
+
金句原文
|
|
327
|
+
sender: "发送者的 [user_id](从群聊记录中对应的 [user_id] 原样选取)"
|
|
328
|
+
reason: |-
|
|
329
|
+
选择这句话的理由(需明确说明逆天特质,不要在里面添加任何markdown语法,请使用纯文本)
|
|
330
|
+
\`\`\``),
|
|
331
|
+
promptUserPersona: koishi_1.Schema.string()
|
|
332
|
+
.description('跨群用户画像分析的提示词模板。')
|
|
333
|
+
.role('textarea')
|
|
334
|
+
.default(`你是一名专业的社群观察员,请基于提供的用户聊天记录,给出该用户的最新画像总结,并在更新时严谨比对历史画像。
|
|
335
|
+
|
|
336
|
+
要求:
|
|
337
|
+
1. 先阅读「历史画像」,理解已有结论。
|
|
338
|
+
2. 再阅读「最新聊天记录」,分析过去 {personaLookbackDays} 天内该用户在多个群的活跃情况。
|
|
339
|
+
3. 如果历史画像为空,则从零开始构建;否则基于历史画像。融合生成新的用户画像。
|
|
340
|
+
4. 输出时请确保条理清晰、总结恰当,中性。输出的 yaml 内容里,为纯文本格式,不要包含 markdown 标记,如 ** 加粗。
|
|
341
|
+
5. 注意 evidence,需要选出 15-25 句最具冲击力、最令人惊叹的"金句"。这些金句需满足,**逆天的神人发言**,即具备颠覆常识的脑洞、逻辑跳脱的表达或强烈反差感的原创内容。
|
|
342
|
+
|
|
343
|
+
历史画像:{previousAnalysis}
|
|
344
|
+
最新聊天记录:{messages}
|
|
345
|
+
用户角色: {roles}
|
|
346
|
+
|
|
347
|
+
请严格按照以下 YAML 格式返回,放在代码块中:
|
|
348
|
+
\`\`\`yaml
|
|
349
|
+
- userId: "{userId}"
|
|
350
|
+
summary: |-
|
|
351
|
+
对整体聊天记录的提炼(性格特点,发言语气等,几段话)(如果和之前的用户画像合一起,太多了的话,超过了300字,需要精简)
|
|
352
|
+
keyTraits:
|
|
353
|
+
- "核心性格特质(列出几点)" (如果和之前的用户画像合一起,太多了的话,需要精简,用字符串围起来)
|
|
354
|
+
interests:
|
|
355
|
+
- "关注的主题或爱好" (如果和之前的用户画像合一起,太多了的话,需要精简,用字符串围起来)
|
|
356
|
+
communicationStyle: |-
|
|
357
|
+
描述其发言风格和情绪倾向,几段话。(如果和之前的用户画像合一起,太多了的话,超过了150字,需要精简,用字符串围起来)
|
|
358
|
+
evidence:
|
|
359
|
+
- "对应上面聊天记录中提供的 id,输出纯 id 的引用"(加入多条组成数组,引用到的聊天消息或者你自己挑选的逆天语句)
|
|
360
|
+
lastMergedFromHistory: true/false(是否成功融合历史画像)
|
|
361
|
+
\`\`\``)
|
|
362
|
+
}).description('高级设置'),
|
|
363
|
+
koishi_1.Schema.object({
|
|
364
|
+
promptQueryParser: koishi_1.Schema.string()
|
|
365
|
+
.description('群分析自然语言解析提示词模板。')
|
|
366
|
+
.role('textarea')
|
|
367
|
+
.default(`你是群聊分析助手,负责将用户的自然语言请求解析成结构化查询。
|
|
368
|
+
|
|
369
|
+
已知信息:
|
|
370
|
+
- 当前时间:{currentTime}
|
|
371
|
+
- 当前时区:{timeZone}
|
|
372
|
+
- 平台:{platform}
|
|
373
|
+
- 群聊:{groupName} (guildId: {guildId}, channelId: {channelId})
|
|
374
|
+
- 用户:{currentUserName} (userId: {currentUserId})
|
|
375
|
+
- 用户请求:{query}
|
|
376
|
+
|
|
377
|
+
## 请识别以下信息:
|
|
378
|
+
|
|
379
|
+
1. **action**(3选1):
|
|
380
|
+
|
|
381
|
+
**只分析** - 用户只想了解群聊的信息、事实、数据或总结,不需要你的主观意见或对话
|
|
382
|
+
示例:
|
|
383
|
+
- "最近三小时聊了什么"
|
|
384
|
+
- "今天有哪些话题"
|
|
385
|
+
- "过去一周谁最活跃"
|
|
386
|
+
- "帮我总结昨天的讨论"
|
|
387
|
+
- "xx说过什么"(查证式提问)
|
|
388
|
+
|
|
389
|
+
**分析加对话** - 用户想要基于分析结果的进一步对话或评论,通常包含:询问观点、性格分析、提出见解、引导讨论等
|
|
390
|
+
示例:
|
|
391
|
+
- "分析xx的性格"
|
|
392
|
+
- "告诉我xx这几个小时的话题是什么"
|
|
393
|
+
- "xx最近在关注什么"
|
|
394
|
+
- "你觉得这个讨论怎么样"
|
|
395
|
+
- "总结一下,xx在群里是什么角色"
|
|
396
|
+
- "分析一下群里最近的气氛"(带有观点要求)
|
|
397
|
+
|
|
398
|
+
**只对话** - 用户不需要新的分析,基于已知信息进行聊天或跟进前面的对话
|
|
399
|
+
示例:
|
|
400
|
+
- "你怎么看"(承上文,指代已有分析)
|
|
401
|
+
- "这个话题怎么深入"
|
|
402
|
+
- "你再补充一下"
|
|
403
|
+
- "有其他看法吗"
|
|
404
|
+
- "为什么这样说"
|
|
405
|
+
|
|
406
|
+
2. 关键词 keywords(用户关注的关键词或实体,没有则返回空数组)
|
|
407
|
+
3. 话题 topics(用户关注的主题或领域,没有则返回空数组)
|
|
408
|
+
4. 昵称 nicknames(用户关注的群友昵称,没有则返回空数组)
|
|
409
|
+
5. 目标时间 targetTime:如涉及时间,请输出绝对时间(YYYY-MM-DD HH:mm:ss);否则留空字符串。可以补充 description。
|
|
410
|
+
|
|
411
|
+
请严格按照 YAML 输出,放在 markdown 代码块中:
|
|
412
|
+
\`\`\`yaml
|
|
413
|
+
action: 只分析
|
|
414
|
+
keywords:
|
|
415
|
+
- "关键词1"
|
|
416
|
+
topics:
|
|
417
|
+
- "话题1"
|
|
418
|
+
nicknames:
|
|
419
|
+
- "奶龙"
|
|
420
|
+
targetTime:
|
|
421
|
+
description: "最近三小时"
|
|
422
|
+
startTime: "2026-02-01 12:00:00"
|
|
423
|
+
endTime: "2026-02-01 15:00:00"
|
|
424
|
+
\`\`\``),
|
|
425
|
+
promptQueryChat: koishi_1.Schema.string()
|
|
426
|
+
.description('群分析对话回复提示词模板。')
|
|
427
|
+
.role('textarea')
|
|
428
|
+
.default(`你是群聊分析对话助手,需要基于提供的分析结果回答用户的问题。
|
|
429
|
+
|
|
430
|
+
已知信息:
|
|
431
|
+
- 当前时间:{currentTime}
|
|
432
|
+
- 群聊:{groupName} (guildId: {guildId}, channelId: {channelId})
|
|
433
|
+
- 用户:{currentUserName} (userId: {currentUserId})
|
|
434
|
+
- 用户请求:{query}
|
|
435
|
+
|
|
436
|
+
分析结果(纯文本):
|
|
437
|
+
{analysisResult}
|
|
438
|
+
|
|
439
|
+
要求:
|
|
440
|
+
1. 结合分析结果回答用户问题,必要时引用关键事实或趋势。
|
|
441
|
+
2. 若分析结果不足以回答,请说明限制,并给出合理的保守回答。
|
|
442
|
+
3. 回复简洁、中立,不要输出 YAML 或 markdown 代码块。
|
|
443
|
+
`)
|
|
444
|
+
}).description('高级设置')
|
|
445
|
+
]);
|
|
446
|
+
exports.name = 'group-analysis';
|
|
447
|
+
exports.inject = {
|
|
448
|
+
required: ['puppeteer', 'database']
|
|
449
|
+
};
|
|
450
|
+
//# sourceMappingURL=config.js.map
|