Repository navigation
Conversation
Port the XiaoSu smart-search client from the Go reference
(internal/infrastructure/web_search/xiaosu.go): a bearer-authenticated
GET /search/{endpoint}/smart whose hits live under webPages.value.
- register the provider in SearchTool.init_search_tool
- expose api_key / base_path / endpoint in the admin web-search form
- translate the new labels and tips into en-US, zh-Hans and ja
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
平台「内置工具 → 联网搜索」目前支持 Bing、博查、Jina、SerpApi、Tavily、Cloudsway、searXNG、DeepSeek,缺少小宿(Xiaosu)智能搜索。
本 PR 参照小宿官方 Go 客户端的接口契约,把 Xiaosu 接入为新的联网搜索服务商。
改动
bisheng_langchain/gpts/tools/web_search/tool.pyXiaosuSearch:GET https://{base_path}/search/{endpoint}/smart,Authorization: Bearer <api_key>,查询参数q/count/mainText/enableContent/contentType=TEXTwebPages.value[]解析为平台统一的结果结构(标题、摘要、URL、来源、图标、发布时间)SearchTool.init_search_tool中注册xiaosubase_path、endpoint均可配置,默认值与参考实现一致(searchapi.xiaosuai.com/AOLwWFjoedCbmysb)test/tool/test_web_search_xiaosu.py:覆盖默认 URL 与查询参数、Bearer 请求头、结果归一化、自定义 base_path/endpoint,以及 10/60 秒默认超时测试
已在真实部署中联调验证:配置 API Key 后能正常返回搜索结果。