feat: add Tavily search engine alongside DuckDuckGo and SearXNG - #1
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
TAVILY_API_KEYis set, Tavily is tried first in auto-mode before SearXNG and DuckDuckGonet/http+encoding/jsonFiles changed
internal/search/tavily.go(new) —TavilyEngineimplementing theEngineinterface via Tavily REST APIinternal/config/config.go— AddedTavilyAPIKeyfield toSearchConfiginternal/config/loader.go— AddedTAVILY_API_KEYenv var override andTavilyAPIKeymerge supportinternal/search/search.go— Register Tavily engine at position 0 when key is present; updated engine comments and error messagecmd/web-search/main.go— Updated--engineflag usage to includetavily; switched toconfig.Load()for env var supportEnvironment variable changes
TAVILY_API_KEY— when set, enables the Tavily search engineDependency changes
net/httpNotes for reviewers
TAVILY_API_KEYis not set, behavior is identical to before (SearXNG → DuckDuckGo)HealthCheck()validates the API key is non-empty; actual API reachability is checked at query timerun()function incmd/web-search/main.gowas changed fromconfig.DefaultConfig()toconfig.Load()so that environment variables are actually applied🤖 Generated with Claude Code
Automated Review
TavilyEngineproperly implements theEngineinterface, uses the correct Tavily REST API (POST tohttps://api.tavily.com/searchwith Bearer auth), follows existing patterns fromsearxng.go, and integrates cleanly into the config/loader/search wiring. All five files listed in the plan were modified appropriately. No regressions to existing engines — SearXNG and DDG remain functional with the same relative priority. Two minor issues noted but neither blocks approval.