Summary
I would like to add Serply as a websearch_provider option, alongside Tavily, BoCha, Baidu AI Search, Brave, Firecrawl and Exa.
Disclosure: I work with Serply.
Why
- None of the current providers return Google results. Tavily, Exa and Brave use their own indexes, BoCha and Baidu are China-focused, Firecrawl is a crawler first. Users who want Google-quality ranking for the agent's searches currently have no option.
- Serply also exposes Google News and Google Scholar endpoints behind the same API key, so one tool can cover "latest news about X" and "papers about Y" with results from those Google surfaces (useful for research-style questions in group chats).
- The API is a plain
GET https://api.serply.io/v1/search/?q=...&num=... with an X-Api-Key header, so it fits the existing aiohttp + _KeyRotator pattern with no new dependencies.
Proposed change (mirrors the Exa PR #8973)
astrbot/core/tools/web_search_tools.py: SerplyWebSearchTool (web_search_serply) with query, num_results, search_type (web | news | scholar), gl, hl; _serply_search() shaped like _brave_search() including key failover on 401/403/429.
astr_main_agent.py: dispatch arm + citation tool name.
config/default.py: websearch_serply_key: [], "serply" option, secret list schema entry.
- i18n (en-US, zh-CN, ru-RU) and
docs/{en,zh}/use/websearch.md.
- Unit tests for the mapping, request shape, failover and legacy key migration.
Roughly 9 files, about +450 lines including tests and docs. I have the change working locally and live-tested against the Serply API; happy to open the PR if this is welcome, or to adjust the shape (for example, dropping the search_type verticals to keep it web-only) if you prefer.
中文摘要:希望新增 Serply 作为网页搜索提供商。Serply 返回实时的 Google 搜索结果,并提供 Google 新闻和 Google 学术两个垂直搜索,现有提供商均不返回 Google 结果。实现方式与 Exa (#8973) 完全一致,无新依赖,默认不启用。本地已实现并通过真实 API 测试,如果维护者认可,我将提交 PR。声明:我为 Serply 工作。
Checklist
Summary
I would like to add Serply as a
websearch_provideroption, alongside Tavily, BoCha, Baidu AI Search, Brave, Firecrawl and Exa.Disclosure: I work with Serply.
Why
GET https://api.serply.io/v1/search/?q=...&num=...with anX-Api-Keyheader, so it fits the existingaiohttp+_KeyRotatorpattern with no new dependencies.Proposed change (mirrors the Exa PR #8973)
astrbot/core/tools/web_search_tools.py:SerplyWebSearchTool(web_search_serply) withquery,num_results,search_type(web|news|scholar),gl,hl;_serply_search()shaped like_brave_search()including key failover on 401/403/429.astr_main_agent.py: dispatch arm + citation tool name.config/default.py:websearch_serply_key: [],"serply"option, secret list schema entry.docs/{en,zh}/use/websearch.md.Roughly 9 files, about +450 lines including tests and docs. I have the change working locally and live-tested against the Serply API; happy to open the PR if this is welcome, or to adjust the shape (for example, dropping the
search_typeverticals to keep it web-only) if you prefer.中文摘要:希望新增 Serply 作为网页搜索提供商。Serply 返回实时的 Google 搜索结果,并提供 Google 新闻和 Google 学术两个垂直搜索,现有提供商均不返回 Google 结果。实现方式与 Exa (#8973) 完全一致,无新依赖,默认不启用。本地已实现并通过真实 API 测试,如果维护者认可,我将提交 PR。声明:我为 Serply 工作。
Checklist