generated from Soulter/helloworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_conf_schema.json
More file actions
165 lines (165 loc) · 8 KB
/
_conf_schema.json
File metadata and controls
165 lines (165 loc) · 8 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
{
"trigger_mode": {
"description": "检测触发模式",
"type": "string",
"options": ["time_only", "count_only", "hybrid", "strict_hybrid"],
"default": "hybrid",
"hint": "time_only: 仅定时触发 | count_only: 仅消息数量触发 | hybrid: 时间或数量任一达标触发 | strict_hybrid: 时间和数量都达标才触发(更省 token)"
},
"check_interval": {
"description": "检测时间间隔(秒)",
"type": "int",
"default": 60,
"hint": "每隔多少秒检测一次消息累积情况(适用于 time_only 和 hybrid 模式)"
},
"batch_size": {
"description": "触发检测的消息数量",
"type": "int",
"default": 10,
"hint": "累积多少条消息后触发检测(适用于 count_only 和 hybrid 模式)"
},
"recent_message_limit": {
"description": "严格混合模式最近消息窗口",
"type": "int",
"default": 50,
"hint": "仅 strict_hybrid 生效。只保留最近 N 条消息用于缓冲与送审;设为 0 表示不限制"
},
"ban_duration": {
"description": "禁言时长(秒)",
"type": "int",
"default": 600,
"hint": "检测到违规内容后的禁言时长,0 表示解除禁言"
},
"enabled_groups": {
"description": "启用的群组列表",
"type": "list",
"default": [],
"hint": "仅对这些群组生效(填写群号),留空则对所有群组生效"
},
"whitelist_users": {
"description": "白名单用户",
"type": "list",
"default": [],
"hint": "这些用户的消息不会被检测(填写 QQ 号)"
},
"llm_provider": {
"description": "LLM 提供商",
"type": "string",
"_special": "select_provider",
"hint": "选择用于内容审核的 LLM 提供商"
},
"default_review_rules": {
"description": "默认审核规则(预置提示词)",
"type": "text",
"default": "1. 阴阳怪气、讽刺挖苦、挑衅行为\n2. 争吵辱骂、人身攻击、恶意诋毁\n3. 敏感话题(政治、宗教、色情、暴力等)\n4. 恶意刷屏、广告骚扰",
"hint": "这是预先填好的默认规则,你可以直接修改。插件会自动与 custom_review_rules 拼接。"
},
"custom_review_rules": {
"description": "自定义违规规则(追加)",
"type": "text",
"default": "",
"hint": "仅填写你想额外禁止的内容,插件会自动与默认规则拼接,并固定JSON输出格式。示例:禁止地域黑、引战游戏话题、连续@他人骚扰。"
},
"slang_feature_enabled": {
"description": "黑话功能总开关",
"type": "bool",
"default": true,
"hint": "关闭后不拼接任何黑话相关提示词(检索增强与候选新黑话发现均停用)"
},
"slang_detection_enabled": {
"description": "启用黑话检索增强",
"type": "bool",
"default": true,
"hint": "开启后在 LLM 审核前增加词库检索证据(命中后仍需 LLM 复核)"
},
"slang_match_case_sensitive": {
"description": "黑话检索区分大小写",
"type": "bool",
"default": false,
"hint": "默认不区分大小写,适合群聊文本场景"
},
"slang_max_hits": {
"description": "单次审核最多注入检索证据条数",
"type": "int",
"default": 12,
"hint": "限制注入到提示词中的命中条数,避免上下文过长"
},
"candidate_discovery_enabled": {
"description": "启用候选新黑话自动发现",
"type": "bool",
"default": true,
"hint": "在常规审核时让 LLM 同步返回疑似新黑话候选,并自动写入候选池"
},
"candidate_min_confidence": {
"description": "候选新黑话最小置信度",
"type": "float",
"default": 0.75,
"hint": "仅保存不低于该置信度的候选新黑话,范围 0.0-1.0"
},
"candidate_max_items": {
"description": "单次审核最多保存候选数",
"type": "int",
"default": 5,
"hint": "每次 LLM 返回候选后最多保留前 N 条高置信候选"
},
"candidate_discovery_prompt": {
"description": "候选新黑话发现提示词",
"type": "text",
"default": "请额外分析是否存在疑似的网络黑话/隐语,在 JSON 中增加 suspected_slangs 字段。\n\n【黑话识别线索】:\n1. 政治隐喻:用看似无关的事物指代政治人物、事件\n - 特征:反复出现、上下文带强烈褒贬情感、指代对象不明确\n - 示例模式:食物名、数字组合、历史人物、地理名词\n - 关键判断:如果去掉字面意思,整句话失去讽刺/批评意图 → 高度疑似\n\n2. 辱骂代称:用变形、谐音、缩写规避敏感词检测\n - 示例:拼音缩写(nmsl)、拆字(口区)、谐音(战狼→占狼)\n\n3. 群体暗号:特定圈子内特殊含义的词汇\n - 示例:饭圈黑话、游戏术语转化、地域梗\n\n【识别要求】:\n- confidence: 置信度 0.0-1.0(需结合上下文情感、出现频率、语义不合理度判断)\n- 政治隐喻置信度建议:如果消息中多次提及且带明显贬义 → 0.8-0.95\n- category: political_metaphor(政治隐喻)| abuse(辱骂)| general(通用黑话)\n- hint: 一句话说明可能的真实指代或隐喻含义\n- reason: 为什么认为是黑话(如:多次出现+贬义语境+语义不合理)\n\n【重要提示】:\n- 正常的日常用语(如真的在讨论鸡蛋、食物)不应识别为黑话\n- 需要结合整个对话的上下文和情感倾向判断\n- 优先识别反复出现的可疑词汇\n\n输出格式示例:\n{\"violations\": [...], \"suspected_slangs\": [{\"term\": \"疑似新词\", \"confidence\": 0.85, \"reason\": \"反复出现+贬义语境+指代不明\", \"category\": \"political_metaphor\", \"hint\": \"可能指代某政治人物\", \"examples\": [\"原文例句1\", \"原文例句2\"]}]}\n\n如果没有疑似黑话,返回 suspected_slangs 为空数组。",
"hint": "候选发现任务的完整提示词,可根据实际场景调优(如专注特定类型黑话、调整置信度判断标准等)"
},
"send_warning": {
"description": "发送警告消息",
"type": "bool",
"default": true,
"hint": "禁言后是否在群内发送警告消息"
},
"warning_template": {
"description": "警告消息模板",
"type": "string",
"default": "⚠️ 用户 {user} 因 {reason} 已被禁言 {duration} 秒。请注意文明发言。",
"hint": "支持变量: {user}(用户ID), {reason}(违规原因), {duration}(禁言时长)"
},
"llm_api_timeout": {
"description": "LLM API 响应超时(秒)",
"type": "int",
"default": 30,
"hint": "LLM 调用的超时时间,超过此时间未收到响应则判定为超时,单位为秒"
},
"log_llm_response": {
"description": "记录 LLM 原始返回(调试用)",
"type": "bool",
"default": false,
"hint": "开启后会将 LLM 的原始响应输出到日志(DEBUG 级别),用于调试提示词效果和排查解析问题。注意:可能包含敏感内容"
},
"api_timeout_seconds": {
"description": "平台 API 调用超时(秒)",
"type": "int",
"default": 60,
"hint": "调用群聊平台 API(如禁言)的超时时间,单位为秒"
},
"message_buffer_max_age": {
"description": "消息缓冲过期时间(秒)",
"type": "int",
"default": 3600,
"hint": "超过此时间的旧消息将被清理,防止内存泄漏,单位为秒"
},
"violation_cooldown_seconds": {
"description": "用户违规冷却期(秒)",
"type": "int",
"default": 3600,
"hint": "同一用户在冷却期内新增违规将被忽略(防止重复禁言),单位为秒"
},
"event_cache_max_age": {
"description": "事件缓存过期时间(秒)",
"type": "int",
"default": 1800,
"hint": "事件缓存超过此时间后将被清理,单位为秒"
},
"violation_records_expire_days": {
"description": "违规记录保留天数",
"type": "int",
"default": 7,
"hint": "超过此天数的违规记录将被自动清理,单位为天"
}
}