feat(web): add Metaso as a web search provider (metaso.cn)#1766
feat(web): add Metaso as a web search provider (metaso.cn)#1766mrluanma wants to merge 2 commits into
Conversation
Adds Metaso AI Search as a new SearchProvider option alongside Bing, DuckDuckGo, Tavily, and Bocha.
There was a problem hiding this comment.
Code Review
This pull request adds Metaso as a new web search provider, including the necessary implementation in the web search tool, configuration updates, and documentation. The reviewer identified a security risk regarding the hardcoded default API key and suggested that the new unit test should mock network responses to ensure isolation from external services.
| let result = WebSearchTool | ||
| .execute(json!({"query": "anything"}), &ctx) | ||
| .await; |
There was a problem hiding this comment.
This test case triggers a real network request to metaso.cn because the Metaso provider uses a built-in default API key. Unit tests should be isolated from external services to ensure they are fast and reliable, especially in CI environments without internet access. Consider mocking the HTTP response or refactoring the code to test the API key resolution logic without making an actual network call.
|
Your api key was exposed..... |
The bundled default API key has the 100/day quota per IP, it's intended to hardcode it in the code. |
Adds an AGENTS.md entry and inline source comment explaining that the hardcoded Metaso key is publicly provided for open-source use, rate-limited to 100 searches/day, and is the last-resort fallback.
|
This PR was opened before the v0.8.41 rebrand and is now stale. Feel free to rebase onto current |
Summary
Adds Metaso AI Search as a new SearchProvider option alongside Bing, DuckDuckGo, Tavily, and Bocha.
Testing
cargo test --all-featurescargo fmt --all -- --checkcargo clippy --all-targets --all-featuresChecklist