feat: migrate search to support Tavily as configurable provider#2
Open
tavily-integrations wants to merge 1 commit intoVincentwei1021:masterfrom
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
search()dispatch function routes to Tavily whenSEARCH_PROVIDER=tavilyandTAVILY_API_KEYis set, otherwise falls back to DuckDuckGo/v1/searchroute, MCP SSE server, and standalone MCP server to use the provider-aware dispatchFiles changed
src/services/search.ts— AddedsearchTavily()andsearch()dispatch functionsrc/routes/search.ts— Switched fromsearchDuckDuckGotosearchdispatchsrc/mcp-sse.ts— Switched tosearchdispatch, updated tool descriptionsrc/mcp-server.ts— Switched tosearchdispatch, updated tool descriptionpackage.json— Added@tavily/coredependency.env.example— DocumentedSEARCH_PROVIDERandTAVILY_API_KEYDependency changes
@tavily/core^0.6.4 (npm)Environment variable changes
SEARCH_PROVIDER(optional, default:duckduckgo, values:duckduckgo|tavily)TAVILY_API_KEY(required whenSEARCH_PROVIDER=tavily)Notes for reviewers
contentfield where DuckDuckGo usessnippet— the mapping is handled insearchTavily()SearchResultinterface is unchanged🤖 Generated with Claude Code
Automated Review
src/services/search.tscorrectly routes to Tavily when configured and falls back to DuckDuckGo otherwise, all callers (route handler, mcp-sse, mcp-server) are updated to use the newsearchexport,@tavily/coreis properly added as a dependency, and env vars are documented in.env.example. The Tavily SDK usage (tavily()client +client.search()) is correct. Three minor issues exist but none block approval.