[FEAT] Add native Baidu Search provider for Agent web browsing#5388
[FEAT] Add native Baidu Search provider for Agent web browsing#5388jimmyzhuu wants to merge 2 commits intoMintplex-Labs:masterfrom
Conversation
timothycarambat
left a comment
There was a problem hiding this comment.
Can we get a video/screencapture of the:
- Running a request against this engine (devs cannot signup since no wxinPay account)
- UI of the search picker showing this option
| { | ||
| name: "Baidu Search", | ||
| value: "baidu-search", | ||
| logo: AnythingLLMIcon, |
There was a problem hiding this comment.
This should be a 300x300 Baidu Icon with a white BG
There was a problem hiding this comment.
Updated in 75c2005 with the provided 300x300 white-background Baidu logo.
| @@ -0,0 +1,72 @@ | |||
| /* eslint-env jest, node */ | |||
There was a problem hiding this comment.
You can remove this test I think - as it only check Baidu and we would realistically want this on all providers
There was a problem hiding this comment.
Removed in 75c2005 so we do not keep a Baidu-specific test here.
| body: JSON.stringify({ | ||
| messages: [{ role: "user", content: query }], | ||
| resource_type_filter: [{ type: "web", top_k: 10 }], | ||
| search_source: "baidu_search_v2", |
There was a problem hiding this comment.
This is an optional and fixed value - we can probably remove it
There was a problem hiding this comment.
Removed in 75c2005 so we now rely on the API default instead of forcing a fixed search source.
|
Addressed the requested review updates in
Demo assets for verification are here:
Google Drive folder: https://drive.google.com/drive/folders/1-5gQ35FZRU0tHhzcTeQf-mdbzabpaUrm
|
Summary
This PR adds Baidu Search as a native web search provider for the Agent web-browsing skill.
Until now, Baidu was only exposed as an engine option under third-party providers like SerpApi/SearchApi. That still depended on an intermediary service. This change adds a first-class
baidu-searchprovider so AnythingLLM can use Baidu Search directly for web retrieval, which is especially useful for stronger zh-CN search coverage.Closes #5387
What changed
baidu-searchto the Agent web search provider switchweb_searchAGENT_BAIDU_SEARCH_API_KEYin system settings and env syncingWhy
AnythingLLM already supports multiple native web-search providers at the top level for the Agent skill. Baidu is a meaningful gap if we want better Chinese-language web retrieval without forcing users to go through a third-party aggregator.
This keeps the feature aligned with the current product model:
Testing
corepack yarn lint:cicorepack yarn testcorepack yarn build(frontend)web_searchwith a real API key:referencesNotes