add WebSearchTool with Metaso API integration#133
Open
mrluanma wants to merge 1 commit into
Open
Conversation
Implement web_search tool using the Metaso search API. The tool supports query-based web search with configurable result count, API key resolution from METASO_API_KEY env var, and comprehensive error handling for rate limits, auth failures, and daily quotas. Metaso provides 100-free-searches/day quota. You can set your own `METASO_API_KEY` environment variable to raise that limit.
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.
Description
Adds
WebSearchTool— a web search tool backed by the Metaso API — and registers it in the default agent toolset. Includes a built-in default API key with ~100 free searches/day.Related Issues
None.
Changes Made
nanobot/agent/tools/web.py— Added_get_metaso_api_key()helper (falls back to built-in default key), andWebSearchToolclass withweb_searchname, supportingqueryand optionaltopKparams.nanobot/agent/loop.py— Imported and registeredWebSearchToolalongsideWebFetchTool.nanobot/workspace/TOOLS.md— Documented the newweb_searchtool.tests/web_search_test.py— 387 lines of tests covering API key resolution, search responses, error handling, and edge cases.