feat: add Tavily as a web search provider option#2
Open
tavily-integrations wants to merge 1 commit into
Open
Conversation
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.
Summary
Adds Tavily as a fifth configurable search provider in ForgeGod's web search pipeline. This is an additive change — all existing providers (SearXNG, DuckDuckGo, Brave, Exa) remain fully functional and unchanged.
What changed
forgegod/tools/web.py: Added_search_tavily()async function usingtavily-pythonAsyncTavilyClient, normalising results to the shared{url, title, snippet}schema. Extendedweb_search()to acceptprovider='tavily'andtavily_api_keyparameter. Added'tavily'as the last entry in the fallback chain.forgegod/config.py: Addedtavily_api_key: str = ''field toReconConfig. Updatedsearch_providerfield comment to listtavilyas a valid value.forgegod/researcher.py: Passestavily_api_keyfromReconConfigthrough toweb_search()in_execute_searches(), matching the existing pattern forbrave_api_keyandexa_api_key.pyproject.toml: Addedtavily-python>=0.5as an optional dependency under a newtavilyextra and included it in theallextra.Dependency changes
tavily-python>=0.5(optional extra[tavily]and[all])Environment variable changes
TAVILY_API_KEY— read intoReconConfig.tavily_api_keyBRAVE_API_KEYandEXA_API_KEYunchangedNotes for reviewers
_search_tavily()) so it's only needed when actually used.Automated Review
{url, title, snippet}. All four files listed in the plan are modified. The optional dependency is registered correctly in both a named[tavily]extra and the[all]catch-all.ReconConfiggains thetavily_api_keyfield,Researcher._execute_searches()passes it through, and the fallback chain inweb_search()includes Tavily last. No regressions, no dead code, no unintended changes.