feat: add Tavily as configurable search provider alongside Serper#70
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 configurable search provider option alongside the existing Serper integration. When a user provides a Tavily API key, the system routes search calls through the Tavily SDK; otherwise it falls back to Serper. No existing Serper code is removed.
Changes
Core (Python)
core/src/tools/tavily_tool.py(new):TavilyToolclass implementing the samesearch(query, k) -> List[Dict]interface asSerperTool, using thetavily-pythonSDKcore/src/agents/researcher_agent.py: Addedtavily_api_keyparameter; selectsTavilyToolorSerperToolat instantiation; renamed internalserper_tooltosearch_toolcore/src/tools/illustration_tool.py: Constructor now accepts a genericsearch_toolparameter instead ofSerperTool-specific typecore/src/worker.py: ExtractstavilyApiKeyfrom task config and passes it through toResearcherAgentcore/src/config.py: AddedTAVILY_API_KEYenv varcore/pyproject.toml: Addedtavily-python>=0.5.0dependencyClient (TypeScript/React)
client/store/useSettingsStore.ts: Addedtavilyfield toApiKeysinterfaceclient/components/settings-dialog.tsx: Added Tavily API Key input fieldclient/lib/api.ts: AddedtavilyApiKeyparameter tosendMessageclient/app/chat/page.tsx: PassestavilyApiKeyfrom settings tosendMessageclient/app/chat/[chatId]/page.tsx: PassestavilyApiKeyfrom settings tosendMessageAPI (TypeScript/Express)
api/src/modules/chat/chat.validation.ts: AddedtavilyApiKeyto message request schemaapi/src/modules/chat/chat.controller.ts: ExtractstavilyApiKeyfrom request bodyapi/src/modules/chat/chat.service.ts: AddedtavilyApiKeyto config type (flows into Redis payload)Infrastructure
k8s/secrets.template.yaml: AddedTAVILY_API_KEYsecret entry.gitignore: Added Python cache entries (__pycache__/,*.pyc)Dependency changes
tavily-python>=0.5.0tocore/pyproject.tomlEnvironment variable changes
TAVILY_API_KEY(optional) — existingSERPER_API_KEYremains unchangedNotes for reviewers
TavilyToolusessearch_depth="basic"for cost efficiency; can be tuned laterIllustrationToolimage search is already deactivated, so the type change to genericsearch_toolhas no functional impactAutomated Review
search(query, k)interface as SerperTool, the fallback logic (Tavily when key present, Serper otherwise) is sound, the dependency is added to pyproject.toml, the env var is documented in Config and k8s secrets, and there are no broken imports or regressions. Only minor issues were found.