feat: add new web search tool Brave Search (#6847)

* feat:Brave Search API adapted

* Modified hint message

* Modified according to AI reviews

* chore: revert compose.yml changes

---------

Co-authored-by: Soulter <905617992@qq.com>
This commit is contained in:
daniel5u
2026-04-08 12:00:21 +08:00
committed by GitHub
co-authored by Soulter
parent ef15955096
commit c517cdb490
11 changed files with 194 additions and 8 deletions
+14 -1
View File
@@ -60,6 +60,8 @@ The default AstrBot configuration is as follows:
"web_search": False,
"websearch_provider": "default",
"websearch_tavily_key": [],
"websearch_bocha_key": [],
"websearch_brave_key": [],
"web_search_link": False,
"display_reasoning_text": False,
"identifier": False,
@@ -286,16 +288,27 @@ Whether to enable AstrBot's built-in web search capability. Default is `false`.
#### `provider_settings.websearch_provider`
Web search provider type. Default is `default`. Currently supports `default` and `tavily`.
Web search provider type. Default is `default`. Currently supports `default`, `tavily`, `bocha`, `baidu_ai_search`, and `brave`.
- `default`: Works best when Google is accessible. If Google fails, it tries Bing and Sogou in order.
- `tavily`: Uses the Tavily search engine.
- `bocha`: Uses the BoCha search engine.
- `baidu_ai_search`: Uses Baidu AI Search (MCP).
- `brave`: Uses Brave Search API.
#### `provider_settings.websearch_tavily_key`
API Key list for the Tavily search engine. Required when using `tavily` as the web search provider.
#### `provider_settings.websearch_bocha_key`
API Key list for the BoCha search engine. Required when using `bocha` as the web search provider.
#### `provider_settings.websearch_brave_key`
API Key list for the Brave search engine. Required when using `brave` as the web search provider.
#### `provider_settings.web_search_link`
Whether to prompt the model to include links to search results in the reply. Default is `false`.
+14 -1
View File
@@ -60,6 +60,8 @@ AstrBot 默认配置如下:
"web_search": False,
"websearch_provider": "default",
"websearch_tavily_key": [],
"websearch_bocha_key": [],
"websearch_brave_key": [],
"web_search_link": False,
"display_reasoning_text": False,
"identifier": False,
@@ -286,16 +288,27 @@ ID 白名单。填写后,将只处理所填写的 ID 发来的消息事件。
#### `provider_settings.websearch_provider`
网页搜索提供商类型。默认为 `default`。目前支持 `default` 和 `tavily`。
网页搜索提供商类型。默认为 `default`。目前支持 `default`、`tavily`、`bocha`、`baidu_ai_search`、`brave`。
- `default`:能访问 Google 时效果最佳。如果 Google 访问失败,程序会依次访问 Bing, Sogo 搜索引擎。
- `tavily`:使用 Tavily 搜索引擎。
- `bocha`:使用 BoCha 搜索引擎。
- `baidu_ai_search`:使用百度 AI Search(MCP)。
- `brave`:使用 Brave Search API。
#### `provider_settings.websearch_tavily_key`
Tavily 搜索引擎的 API Key 列表。使用 `tavily` 作为网页搜索提供商时需要填写。
#### `provider_settings.websearch_bocha_key`
BoCha 搜索引擎的 API Key 列表。使用 `bocha` 作为网页搜索提供商时需要填写。
#### `provider_settings.websearch_brave_key`
Brave 搜索引擎的 API Key 列表。使用 `brave` 作为网页搜索提供商时需要填写。
#### `provider_settings.web_search_link`
是否在回复中提示模型附上搜索结果的链接。默认为 `false`。