Skip to content

Commit d9387cc

Browse files
committed
docs(ecosystem/plugin): update search-service documentation
- Reformat configuration options for better readability - Add new configuration options: summaryType, multiSourceMode, searchThreshold - Update default values and descriptions for existing options - Improve formatting and consistency throughout the document
1 parent da9886a commit d9387cc

File tree

1 file changed

+71
-43
lines changed

1 file changed

+71
-43
lines changed

docs/ecosystem/plugin/search-service.md

Lines changed: 71 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
## 配置
66

7-
- 前往插件市场,安装 `puppeteer` 插件。(大部分情况下 Koishi 已经安装了此插件,直接启用就好)
8-
- 前往插件市场搜索 `chatluna-search-service` 并安装。
7+
* 前往插件市场,安装 `puppeteer` 插件。(大部分情况下 Koishi 已经安装了此插件,直接启用就好)
8+
* 前往插件市场搜索 `chatluna-search-service` 并安装。
99

1010
![alt text](../../public/images/image-56.png)
1111

@@ -61,153 +61,181 @@
6161

6262
#### searchEngine
6363

64-
- 类型: `string[]`
65-
- 默认值: `[]`
64+
* 类型: `string[]`
65+
* 默认值: `[]`
6666

67-
启用的搜索引擎列表。可选值包括:`bing-web``google-web``duckduckgo-lite``serper``tavily``bing-api``searxng``wikipedia`
67+
启用的搜索引擎列表。可选值包括: `bing-web``google-web``duckduckgo-lite``serper``tavily``bing-api``searxng``wikipedia`
6868

6969
此配置项支持多选,意味着你可以同时启用多个搜索引擎进行聚合搜索。
7070

7171
#### topK
7272

73-
- 类型: `number`
74-
- 默认值: `5`
75-
- 范围: `2-20`
73+
* 类型: `number`
74+
* 默认值: `5`
75+
* 范围: `2-20`
7676

7777
参考结果数量。此值决定每次搜索返回的结果数量。
7878
此值不要设置过大或者过小,都会影响到模型输出的质量。
7979
我们推荐配置在 `3-6` 之间。
8080

8181
#### enhancedSummary
8282

83-
- 类型: `boolean`
84-
- 默认值: `false`
83+
* 类型: `boolean`
84+
* 默认值: `false`
8585

8686
是否启用增强摘要功能。启用后会对搜索结果的网页进行访问,以求获取更详细的内容。
8787

8888
#### puppeteerTimeout
8989

90-
- 类型: `number`
91-
- 默认值: `60000`
90+
* 类型: `number`
91+
* 默认值: `60000`
9292

9393
Puppeteer 操作超时时间(毫秒)。
9494

9595
#### puppeteerIdleTimeout
9696

97-
- 类型: `number`
98-
- 默认值: `300000`
97+
* 类型: `number`
98+
* 默认值: `300000`
9999

100100
Puppeteer 空闲超时时间(毫秒)。
101101

102102
#### summaryModel
103103

104-
- 类型: `string`
105-
- 默认值: `gpt-3.5-turbo`
104+
* 类型: `string`
105+
* 默认值: `gpt-3.5-turbo`
106106

107107
处理搜索结果的模型。在启用了增强摘要功能后,会使用此模型总结和分析搜索获取的内容。
108108

109+
#### summaryType
110+
111+
* 类型:`speed` | `balanced` | `quality`
112+
* 默认值:`balanced`
113+
114+
搜索结果摘要的生成策略,提供几种模式:
115+
116+
* `speed`: 优先考虑生成速度,直接返回搜索结果。
117+
* `balanced`: 阅读网页,切块返回,提供一定的质量。
118+
* `quality`: 使用 LLM 阅读和总结网页,高质量的结果。
119+
120+
#### multiSourceMode
121+
122+
* 类型: `average` | `total`
123+
* 默认值: `total`
124+
125+
多源搜索结果的聚合策略,提供两种模式:
126+
127+
* `average`: 对每个搜索取前 total / K 个结果,聚合后对每个结果进行相似度检测,返回最高的 K 个结果。
128+
* `total`: 对每个搜索源取前 K 个结果,聚合后对每个结果进行相似度检测,返回最高的 K 个结果。
129+
130+
#### searchThreshold
131+
132+
* 类型: `number`
133+
* 默认值: `0.25`
134+
135+
搜索结果的相似度阈值。使用向量相似度检测,过滤掉相似度低于此阈值的结果。
136+
109137
### Serper 设置
110138

111139
#### serperApiKey
112140

113-
- 类型: `string`
114-
- 默认值: ``
141+
* 类型: `string`
142+
* 默认值: ``
115143

116144
Serper API 密钥。
117145

118146
#### serperCountry
119147

120-
- 类型: `string`
121-
- 默认值: `cn`
148+
* 类型: `string`
149+
* 默认值: `cn`
122150

123151
Serper 搜索地区。
124152

125153
#### serperLocation
126154

127-
- 类型: `string`
128-
- 默认值: `zh-cn`
155+
* 类型: `string`
156+
* 默认值: `zh-cn`
129157

130158
Serper 搜索语言。
131159

132160
#### serperSearchResults
133161

134-
- 类型: `number`
135-
- 默认值: `10`
162+
* 类型: `number`
163+
* 默认值: `10`
136164

137165
Serper 搜索结果数量。
138166

139167
### Bing API 设置
140168

141169
#### bingSearchApiKey
142170

143-
- 类型: `string`
144-
- 默认值: ``
171+
* 类型: `string`
172+
* 默认值: ``
145173

146174
Bing API 密钥。
147175

148176
#### bingSearchLocation
149177

150-
- 类型: `string`
151-
- 默认值: `zh-CN`
178+
* 类型: `string`
179+
* 默认值: `zh-CN`
152180

153181
Bing API 搜索地区。
154182

155183
#### azureLocation
156184

157-
- 类型: `string`
158-
- 默认值: `global`
185+
* 类型: `string`
186+
* 默认值: `global`
159187

160188
Azure API 服务地区。
161189

162190
### Tavily 设置
163191

164192
#### tavilyApiKey
165193

166-
- 类型: `string`
167-
- 默认值: ``
194+
* 类型: `string`
195+
* 默认值: ``
168196

169197
Tavily API 密钥。
170198

171199
### Wikipedia 设置
172200

173201
#### wikipediaBaseURL
174202

175-
- 类型: `string[]`
176-
- 默认值: `["https://en.wikipedia.org/w/api.php", "https://mzh.moegirl.org.cn/api.php"]`
203+
* 类型: `string[]`
204+
* 默认值: `["https://en.wikipedia.org/w/api.php", "https://mzh.moegirl.org.cn/api.php"]`
177205

178206
Wikipedia API 基础 URL。可以添加多个维基网站的 API 地址。
179207

180208
#### maxWikipediaDocContentLength
181209

182-
- 类型: `number`
183-
- 默认值: `5000`
210+
* 类型: `number`
211+
* 默认值: `5000`
184212

185213
Wikipedia 文档内容的最大长度。超出此长度的内容会被截断。
186214

187215
### SearxNG 设置
188216

189217
#### searxngBaseURL
190218

191-
- 类型: `string`
192-
- 默认值: `https://paulgo.io`
219+
* 类型: `string`
220+
* 默认值: `https://paulgo.io`
193221

194222
SearxNG API 基础 URL。可以填写任意可用的 SearxNG 实例地址。
195223

196224
### 进阶设置
197225

198-
> [!WARNING] 提示
226+
> [! WARNING] 提示
199227
> 如果你对 Prompt 工程不够熟悉,不要随意修改以下配置。否则会直接影响模型生成的质量。
200228
201229
#### searchPrompt
202230

203-
- 类型: `string`
204-
- 默认值: `....`
231+
* 类型: `string`
232+
* 默认值: `....`
205233

206234
搜索任务的 Prompt。用于模型理解搜索任务,并基于搜索结果生成符合人类偏好的回答。
207235

208236
#### newQuestionPrompt
209237

210-
- 类型: `string`
211-
- 默认值: `....`
238+
* 类型: `string`
239+
* 默认值: `....`
212240

213241
新问题 Prompt。用于模型理解用户的输入,并基于当前上下文生成新的回答。

0 commit comments

Comments
 (0)