Repository navigation
Expand file tree
/
Copy path_conf_schema.json
More file actions
251 lines (251 loc) · 9.66 KB
/
Copy path_conf_schema.json
File metadata and controls
251 lines (251 loc) · 9.66 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
{
"config_general": {
"description": "⚙️ 通用",
"type": "object",
"items": {
"enabled": {
"description": "启用插件",
"type": "bool",
"default": true,
"hint": "此为必须项"
},
"enable_llm_tool": {
"description": "注册为 AstrBot 函数工具",
"type": "bool",
"default": true,
"hint": "此为必须项"
},
"enable_force_commands": {
"description": "启用内部指令",
"type": "bool",
"default": true,
"hint": "比如 /search 和 /搜索"
},
"auto_search_policy": {
"description": "搜索策略",
"type": "string",
"default": "tool",
"options": ["tool", "always"],
"labels": ["LLM 自主判断", "总是执行"],
"hint": "总是执行:会让普通消息也执行一次浏览器任务"
},
"max_urls_per_request": {
"description": "单次最多处理的 URL 数",
"type": "int",
"default": 3
}
}
},
"config_force_trigger": {
"description": "🕹️ 强制触发(通过内部指令或触发词)",
"type": "object",
"items": {
"enable_force_prefixes": {
"description": "启用强制触发词",
"type": "bool",
"default": false,
"hint": "关闭本选项可阻止插件被除内部指令以外的方式强制触发,使用本插件的时机完全由 [主 Bot] 判断"
},
"force_trigger_mode": {
"description": "处理模式",
"type": "string",
"default": "main_bot",
"options": ["main_bot", "direct_reply"],
"labels": ["✨ Bot 框架", "🎯 仅插件"],
"hint": "[Bot 框架] 模式:强制插入搜索结果内容到 {主 Bot} 的提示词 | [仅插件] 模式:绕过 {主 Bot} 使用单独的 LLM 总结并回复"
},
"force_prefixes": {
"description": "触发词列表",
"type": "list",
"default": ["搜索", "search"],
"items": {
"type": "string"
}
}
}
},
"config_main_bot": {
"description": "✨ Bot 框架 模式(非全局)",
"type": "object",
"items": {
"forced_evidence_prompt_template": {
"description": "主 Bot 提示词注入模板",
"type": "text",
"default": "用户明确要求使用 Obscura 浏览器能力。下面是通过 Obscura 得到的证据,请结合当前人格、上下文和用户原始问题回答。\n\n要求:\n1. 优先依据浏览器证据回答。\n2. 不要把证据之外的推测说成事实。\n3. 如证据不足或浏览失败,请按当前对话风格说明。\n4. 如果引用来源,可以使用 [1]、[2] 这样的编号。\n\n总结侧重点:{summary_focus}\n\n用户需求:\n{query}\n\n浏览器证据:\n{evidence}\n",
"hint": "必须包含 {query} 和 {evidence}"
}
}
},
"config_direct_reply": {
"description": "🎯 仅插件 模式(非全局)",
"type": "object",
"items": {
"summary_provider_id": {
"description": "LLM",
"type": "string",
"default": "",
"_special": "select_provider",
"hint": "为空时默认使用当前会话的模型"
},
"summary_prompt_source": {
"description": "总结提示词来源",
"type": "string",
"default": "file",
"options": ["file", "config"]
},
"summary_prompt_template": {
"description": "总结提示词模板",
"type": "text",
"default": "你是一个严谨的联网浏览助手。请基于下面的 Obscura 浏览器材料回答用户问题。\n\n要求:\n1. 优先使用浏览器材料,不要把没有依据的内容说成事实。\n2. 结论后用 [1]、[2] 这样的编号标注来源。\n3. 如果材料不足,请明确说明不足,并给出已找到的信息。\n4. 如果材料包含图片或设计线索,请区分“页面文字/DOM 元数据能确认的内容”和“无法直接确认的视觉细节”。\n5. 用用户提问的语言回答,保持简洁但覆盖关键事实。\n\n总结侧重点:{summary_focus}\n\n用户问题:\n{query}\n\n浏览器材料:\n{evidence}\n",
"hint": "必须包含 {query} 和 {evidence}"
},
"summary_prompt_file": {
"description": "总结提示词文件",
"type": "string",
"default": "prompts/summary.md"
}
}
},
"config_search": {
"description": "🌐 浏览器操作和搜索",
"type": "object",
"items": {
"summary_focus": {
"description": "总结搜索结果的侧重点",
"type": "string",
"default": "auto",
"options": ["auto", "content", "visual_design", "site_overview"],
"hint": "auto 模式:由 LLM 决定 | content 模式:侧重正文文字内容 | visual_design 模式:侧重视觉设计(会提取媒体相关 HTML 标签) | site_overview 模式:侧重网页整体结构(会提取媒体相关 HTML 标签)"
},
"search_engine": {
"description": "首选搜索引擎",
"type": "string",
"default": "duckduckgo_html",
"options": [
"bing_rss",
"duckduckgo_html",
"anysearch_api",
"bocha_api",
"exa_api",
"parallel_api",
"perplexity_api",
"tavily_api",
"custom"
],
"hint": "选择你的搜索引擎,这会作为首选项"
},
"search_api_key": {
"description": "搜索引擎 API Key",
"type": "string",
"default": "",
"hint": "选填,可以填写相应搜索引擎的 API 密钥(仅对需要 API 的生效)"
},
"search_url_template": {
"description": "搜索引擎 URL 模板",
"type": "string",
"default": "https://html.duckduckgo.com/html/?q={query}",
"hint": "选填,可以填写自定义搜索引擎的 URL 模板(仅对 custom 生效)"
},
"result_count": {
"description": "搜索结果数",
"type": "int",
"default": 5,
"hint": "使用浏览器打开网页和抓取内容需要耗费时间,且会消耗设备性能,虽然 Obscura 很快很轻,但是这个项目也要调整为适当的值,默认为 5"
},
"fetch_top_pages": {
"description": "抓取搜索结果正文的数量",
"type": "int",
"default": 3,
"hint": "推荐设置为小于搜索结果数且大于 0. 此数值设置较大会导致明显更多的 Token 消耗。本配置设为 0 则只抓取搜索结果的标题和摘要而没有正文内容"
},
"timeout_seconds": {
"description": "抓取超时秒数(单个页面)",
"type": "int",
"default": 20
},
"max_page_chars": {
"description": "抓取单页正文字符数(单个页面)",
"type": "int",
"default": 4000
}
}
},
"config_media": {
"description": "🖼️ 网页媒体",
"type": "object",
"items": {
"enable_media_extraction": {
"description": "启用媒体提取",
"type": "bool",
"default": false,
"hint": "不支持媒体的搜索引擎,会按照 [🌐 浏览器操作和搜索] 中的设置决定是否使用 Obscura 提取内容"
},
"media_extract_mode": {
"description": "媒体提取模式",
"type": "string",
"default": "images",
"options": ["images", "metadata_only"],
"labels": ["图片链接", "仅图片元数据"],
"hint": "[图片链接] 模式会提取 HTML 中的 <img> 和 <source> 标签"
},
"max_images_per_page": {
"description": "单个网页图片提取数",
"type": "int",
"default": 5
},
"image_caption_provider_id": {
"description": "图片描述模型",
"type": "string",
"default": "",
"_special": "select_provider",
"hint": "为空时默认使用当前会话的模型"
}
}
},
"config_advanced": {
"description": "🚀 高级",
"type": "object",
"items": {
"obscura_path": {
"description": "自定义 Obscura 浏览器二进制文件路径",
"type": "string",
"default": "",
"hint": "为空时会优先使用插件目录下的 obscura 文件夹内的二进制文件(需命名为 obscura), 如果不存在则会尝试在系统 PATH 中寻找"
},
"proxy": {
"description": "Obscura 浏览器代理地址",
"type": "string",
"default": ""
},
"user_agent": {
"description": "自定义浏览器 UA",
"type": "string",
"default": ""
},
"stealth": {
"description": "启用 Obscura Stealth 模式",
"type": "bool",
"default": false,
"hint": "启用 Obscura 的特征隐匿模式,可用于反指纹识别和追踪器阻断"
},
"enable_worker_pool": {
"description": "启用 obscura-worker 会话池",
"type": "bool",
"default": true,
"hint": "批量获取网页时复用短期存活的 worker 进程可减少整体性能开销,任务结束即全部关闭。关闭此选项则回退至单进程抓取模式"
},
"max_workers": {
"description": "会话池最大 worker 数量",
"type": "int",
"default": 3,
"hint": "worker 仅在批量获取网页期间存活,任务结束进程即销毁"
},
"allow_private_urls": {
"description": "允许访问本地和内网资源",
"type": "bool",
"default": false,
"hint": "⚠️ 高安全风险选项,默认关闭,阻止通过浏览器读取本机或内网资源"
}
}
}
}