forked from muyouzhi6/astrbot_plugin_context_aware
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_conf_schema.json
More file actions
330 lines (330 loc) · 12.4 KB
/
Copy path_conf_schema.json
File metadata and controls
330 lines (330 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
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
{
"enable": {
"description": "启用上下文场景感知",
"type": "bool",
"default": true
},
"bot_names": {
"description": "Bot的各种称呼(用于检测被提及,不填则不检测)",
"type": "list",
"default": [],
"hint": "例如填写: 小助手, 机器人, bot"
},
"max_history": {
"description": "每个群保留的最大历史消息数",
"type": "int",
"default": 50
},
"max_groups": {
"description": "最大缓存群数量(LRU淘汰策略,防止内存溢出)",
"type": "int",
"default": 100
},
"dialogue_window": {
"description": "注入LLM的对话流窗口大小(最近N条消息)",
"type": "int",
"default": 8
},
"enable_dialogue_flow": {
"description": "启用对话流分析(谁在和谁说话)",
"type": "bool",
"default": true
},
"only_group_chat": {
"description": "仅对群聊生效(私聊场景无需复杂分析)",
"type": "bool",
"default": true
},
"record_structural_messages": {
"description": "记录只有@/回复/@全体的结构化消息",
"type": "bool",
"default": true,
"hint": "开启后,纯@Bot、纯回复、纯@全体这类没有正文的消息也会进入上下文分析,减少说话对象误判"
},
"warn_builtin_ltm": {
"description": "检测到内置群聊上下文感知时输出警告",
"type": "bool",
"default": true,
"hint": "建议关闭 AstrBot 内置群聊上下文感知,避免和本插件重复注入群聊历史"
},
"show_recent_images": {
"description": "在场景提示中单独列出最近图片消息",
"type": "bool",
"default": true,
"hint": "让未触发对话的图片也以 <recent_images> 形式显式进入后续 LLM 请求;启用图像转述后会显示图片描述"
},
"show_recent_images_allow_gif": {
"description": "允许将GIF图片消息加入最近图片上下文",
"type": "bool",
"default": false,
"hint": "仅当后续模型支持image/gif或你确认需要GIF上下文时开启;关闭时GIF不会进入<recent_images>,也不会触发图像转述",
"condition": {
"show_recent_images": true
}
},
"image_context_window": {
"description": "图片上下文扫描窗口",
"type": "int",
"default": 20,
"min": 1,
"max": 200,
"hint": "从最近 N 条消息中提取图片消息并单独注入,避免图片上下文被普通对话窗口截掉"
},
"voice_context_window": {
"description": "语音转写上下文扫描窗口",
"type": "int",
"default": 50,
"min": 0,
"max": 500,
"hint": "从最近 N 条消息中单独提取 Gemini_STT 的语音转写并注入;0 表示关闭"
},
"debug_inference": {
"description": "启用推断规则调试日志",
"type": "bool",
"default": false,
"hint": "启用后会在日志中输出每条消息的对话对象推断过程"
},
"speaker_identity_mode": {
"description": "LLM 用户身份标签模式",
"type": "string",
"default": "platform_id",
"options": ["platform_id", "masked", "name_only"],
"labels": ["原始平台 ID(QQ 即 QQ 号)", "脱敏稳定标签", "仅昵称(不推荐)"],
"hint": "用于区分同名、改名或动态昵称的不同用户。默认把 AstrBot sender_id 发送给模型;QQ/OneBot 场景中即为 QQ 号。"
},
"speaker_attribution_guard": {
"description": "启用用户发言归因保护",
"type": "bool",
"default": true,
"hint": "明确要求模型只把相同身份标签的历史内容归属给当前用户,防止把其他群成员的话串到当前用户身上。"
},
"speaker_attribution_template": {
"description": "用户发言归因保护提示词",
"type": "text",
"default": "本轮当前用户的唯一身份标签是 {current_speaker}。只有当前消息,以及 speaker 身份标签完全等于 {current_speaker} 的历史内容,才能归属给这位用户。历史摘要、历史对话、图片和语音内容只属于其中各自标明的身份标签;除非身份标签完全一致,严禁把其他用户说过的话、做过的事、偏好或观点归因给当前用户。没有身份标签的历史仅可作为背景,不可作为当前用户曾经说过或做过某事的证据。",
"hint": "可用占位符: {current_speaker}(如 user:123456)。留空时使用内置保护提示词。",
"condition": {
"speaker_attribution_guard": true
}
},
"reply_direction_hint": {
"description": "优化引用回复指向",
"type": "bool",
"default": false,
"hint": "在本轮请求中临时说明当前发言人、被引用消息发送者,以及可唯一确认时 Bot 被引用回复原本回复给谁。QQ 官方 Bot 的引用信息不可靠,会自动跳过。"
},
"reply_direction_hint_template": {
"description": "引用回复指向提示词",
"type": "text",
"default": "这是引用回复的临时指向说明:当前发言人是 {current_speaker};被引用消息的发送者是 {quoted_speaker}。{quoted_bot_reply_target_note}仅按这些身份标签解释引用关系;除非身份标签一致,否则不要把被引用消息、Bot 回复对象或其历史经历归属给当前发言人。",
"hint": "可用占位符: {current_speaker}、{quoted_speaker}、{quoted_bot_reply_target_note}。留空时使用内置提示词。",
"condition": {
"reply_direction_hint": true
}
},
"reply_direction_cleanup_internal_markers": {
"description": "清理引用回复指向内部标记",
"type": "bool",
"default": true,
"hint": "仅在当前模型请求副本中清理旧标记,并移除模型误回显的内部标记;不会批量迁移历史,也不会修改正常聊天内容。",
"condition": {
"reply_direction_hint": true
}
},
"strict_mode": {
"description": "主动或未知触发时严格避免误判为在和 Bot 说话",
"type": "bool",
"default": false,
"hint": "仅在主动/未知触发且当前只由上下文推断为对 Bot 说话时回退为群聊;不会覆盖 @、回复或动态群名片文本点名等明确证据。"
},
"reply_starters": {
"description": "回复特征词(用于判断用户是否在回复Bot)",
"type": "list",
"default": [],
"hint": "留空使用默认词库。例如: 好的, 谢谢, 明白了"
},
"dynamic_name_identity_hint": {
"description": "启用动态群名片身份提示",
"type": "bool",
"default": true,
"hint": "当你在群里动态改名片时,额外告诉模型“被@到的这个名字就是你自己”"
},
"dynamic_name_identity_template": {
"description": "动态群名片身份提示词模板",
"type": "text",
"default": "消息里被点名的“{bot_called_names}”就是你当前的群名片/动态昵称,指的就是你,不是另一个AI。",
"hint": "可用占位符: {bot_called_names}",
"condition": {
"dynamic_name_identity_hint": true
}
},
"dynamic_card_plus_compat": {
"description": "适配 Dynamic Card Plus 动态群名片",
"type": "bool",
"default": true,
"hint": "自动读取 astrbot_plugin_dynamic_card_plus 的基础名字、当前群名片和近期名片,把它们作为 Bot 文本别名参与触发与说话对象判断。"
},
"dynamic_card_plus_identity_hint": {
"description": "为 Dynamic Card Plus 别名启用专用身份提示",
"type": "bool",
"default": true,
"hint": "当消息文本或回复对象昵称命中 Dynamic Card Plus 群名片别名时,额外告诉模型这些名字指的就是它自己。",
"condition": {
"dynamic_card_plus_compat": true,
"dynamic_name_identity_hint": true
}
},
"dynamic_card_plus_identity_template": {
"description": "Dynamic Card Plus 身份提示词模板",
"type": "text",
"default": "消息里出现的“{bot_called_names}”来自 DynamicCardPlus 当前或近期群名片,指的就是你本人,不是另一个人或另一个 AI。",
"hint": "可用占位符: {bot_called_names}",
"condition": {
"dynamic_card_plus_compat": true,
"dynamic_card_plus_identity_hint": true,
"dynamic_name_identity_hint": true
}
},
"dynamic_card_plus_alias_max_count": {
"description": "Dynamic Card Plus 动态别名最大数量",
"type": "int",
"default": 6,
"min": 1,
"max": 20,
"hint": "每次请求最多读取多少个动态名片别名。通常保持默认即可。过大可能增加误触发。dynamic_card_plus_compat 关闭时无效。",
"condition": {
"dynamic_card_plus_compat": true
}
},
"dynamic_card_plus_alias_min_length": {
"description": "Dynamic Card Plus 动态别名最小长度",
"type": "int",
"default": 2,
"min": 1,
"max": 20,
"hint": "用于过滤过短别名,降低把单字或符号误判成 Bot 名字的概率。dynamic_card_plus_compat 关闭时无效。",
"condition": {
"dynamic_card_plus_compat": true
}
},
"image_caption": {
"description": "启用图像转述(将群友发的图片转为文字描述)",
"type": "bool",
"default": false,
"hint": "启用后每张图片会调用一次LLM,会产生额外费用和延迟"
},
"image_caption_provider_id": {
"description": "图像转述使用的提供商",
"type": "string",
"default": "",
"_special": "select_provider",
"hint": "留空则使用默认提供商,需支持图像识别能力",
"condition": {
"image_caption": true
}
},
"image_caption_prompt": {
"description": "图像转述提示词",
"type": "string",
"default": "请用中文简洁描述这张图片的内容,不超过50字。",
"condition": {
"image_caption": true
}
},
"image_caption_timeout": {
"description": "图像转述超时时间(秒)",
"type": "int",
"default": 60,
"min": 10,
"max": 600,
"hint": "本地模型或慢速API建议设置更长时间(如120-300秒)",
"condition": {
"image_caption": true
}
},
"history_compress_strategy": {
"description": "群聊历史压缩策略(可选)",
"type": "string",
"default": "off",
"options": ["off", "llm_summary"],
"labels": ["关闭", "LLM 摘要压缩"],
"hint": "开启后会额外调用一次 LLM 来生成摘要,用于降低上下文膨胀与误判风险。"
},
"history_compress_trigger_count": {
"description": "触发压缩的消息数阈值",
"type": "int",
"default": 48,
"min": 20,
"max": 500,
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_keep_recent": {
"description": "压缩时保留最近消息数",
"type": "int",
"default": 16,
"min": 5,
"max": 200,
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_min_interval_sec": {
"description": "两次压缩的最小间隔(秒)",
"type": "int",
"default": 300,
"min": 30,
"max": 86400,
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_provider_id": {
"description": "用于历史压缩的模型提供商 ID(留空则使用当前会话默认模型)",
"type": "string",
"default": "",
"_special": "select_provider",
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_instruction": {
"description": "历史压缩提示词(留空使用内置默认)",
"type": "text",
"default": "",
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_timeout": {
"description": "历史压缩超时时间(秒)",
"type": "int",
"default": 60,
"min": 10,
"max": 600,
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_max_input_chars": {
"description": "压缩输入最大字符数(超出时从末尾截取)",
"type": "int",
"default": 5000,
"min": 1000,
"max": 50000,
"condition": {
"history_compress_strategy": "llm_summary"
}
},
"history_compress_max_summary_chars": {
"description": "摘要最大字符数(超出截断)",
"type": "int",
"default": 800,
"min": 200,
"max": 5000,
"condition": {
"history_compress_strategy": "llm_summary"
}
}
}