feat: add Tavily as configurable search provider in web_search#1
Open
mani2001 wants to merge 3 commits into
Open
feat: add Tavily as configurable search provider in web_search#1mani2001 wants to merge 3 commits into
mani2001 wants to merge 3 commits into
Conversation
797c6fb to
e5de67e
Compare
753266c to
f9064f9
Compare
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
bin/tool/web_search.py, selectable via theSEARCH_PROVIDERenvironment variableSEARCH_PROVIDER=tavilyroutes queries throughTavilyClient, which requiresTAVILY_API_KEYto be setSource: <url>\n<body>output format, so no changes to the tool dispatch layer are neededFiles changed
bin/tool/web_search.py— Added_search_ddgs()and_search_tavily()helper functions;web_search()now readsSEARCH_PROVIDERenv var to select backendrequirements.txt— Addedtavily-pythonpyproject.toml— Addedtavily-pythonto project dependenciesDependency changes
tavily-python(existingddgs==9.10.0kept)Environment variable changes
SEARCH_PROVIDER(optional, values:ddgs|tavily, defaults toddgs)TAVILY_API_KEY(required whenSEARCH_PROVIDER=tavily)Notes for reviewers
web_search(query) -> strfunction signature is unchanged, sobin/chat.pyandtools.jsonrequire no modifications_search_tavily()to avoid import errors when tavily-python is not installed and ddgs is used🤖 Generated with Claude Code
Automated Review
tavily-python==0.7.23is correctly pinned in bothrequirements.txtandpyproject.toml, matching the existing pinning convention. The README documentation is clear and accurate. Theweb_search.pyimplementation is correct:TavilyClient()without an explicit key is the recommended pattern (readsTAVILY_API_KEYfrom env), the Tavily response fields (r['url'],r['content']) are valid, the lazy import avoidsImportErrorwhen Tavily is not selected, and DuckDuckGo remains the default with no regression. No unrelated files were touched.