feat(search): add Tavily search provider#95
Open
teionarr wants to merge 1 commit into
Open
Conversation
Adds TavilySearch alongside the existing Firecrawl/Brave/Bing/Google/DDGS providers, following the same Tool interface (List[SearchItem] -> ToolResponse), with search_depth defaulting to "basic" (1 credit) and opt-in "advanced". - Registered via @TOOL.register_module and exported from the search package - Wired into WebSearcherTool.search_tools (commented, matching the other key-requiring engines; enable by uncommenting + setting TAVILY_API_KEY) - Adds tavily-python to requirements.txt Also makes the existing TAVILY_API_KEY check in tests/test_report_tool.py meaningful, which previously had no Tavily provider behind it.
Author
|
Hi 👋 — this adds Motivation: Verified against the live Tavily API ( |
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.
What
Adds
TavilySearchas a search provider alongside the existing Firecrawl / Brave / Bing / Google / DDGS backends.Why
tests/test_report_tool.pyalready listsTAVILY_API_KEYas a required env var, but no Tavily provider existed in the codebase. This adds it, following the sameToolinterface as the other search backends.Changes
src/tool/default_tools/search/tavily_search.py— newTavilySearch(Tool), registered via@TOOL.register_module, returnsList[SearchItem]/ToolResponseexactly likeFirecrawlSearch.src/tool/default_tools/search/__init__.py.WebSearcherTool.search_tools(commented, matching the other key-requiring engines — enable by uncommenting + settingTAVILY_API_KEY).tavily-python>=0.7.12added torequirements.txt.Notes
search_depthdefaults to"basic"(1 credit / low latency); callers can opt into"advanced".filter_yeardefaults toNone(no date restriction) so current-year results aren't excluded.country/langare accepted for interface parity but not forwarded (Tavily expects full country names, not the ISO codes the shared interface passes) — same approach the other providers take with unused kwargs.Testing
Verified against the live Tavily API (tavily-python 0.7.26): search returns correctly-mapped
SearchItemresults with populated title/url/content. The provider'ssrc.*imports are identical toFirecrawlSearch.