feat: add Tavily as configurable search provider alongside DuckDuckGo#46
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 an optional, configurable web search strategy alongside the existing DuckDuckGo+Puppeteer implementation. When
TAVILY_API_KEYis set as an environment secret, the research workflow automatically uses Tavily's search API (withadvancedsearch depth and raw markdown content) instead of browser-based DuckDuckGo scraping. When no key is configured, the existing DuckDuckGo+Puppeteer path is used unchanged.Changes
New functionality
src/webSearch.ts: AddedtavilySearch()function using@tavily/coreSDK that returns results matching the existingSearchResultinterfacesrc/workflows.ts: AddedcreateTavilySearchStrategy()factory and wired it intoResearchWorkflow.run()— selects Tavily whenTAVILY_API_KEYis presentsrc/config.ts: AddedtavilySearchconfig section withmaxResultsandsearchDepthsettingssrc/bindings.d.ts: Added optionalTAVILY_API_KEYto theEnvtypesrc/logger.ts: Extended logger source type to include"tavily".dev.vars.example: AddedTAVILY_API_KEYplaceholderFiles changed
src/webSearch.tssrc/workflows.tssrc/bindings.d.tssrc/config.tssrc/logger.ts.dev.vars.examplepackage.jsonpackage-lock.jsonDependency changes
@tavily/core(^0.7.3) — official Tavily JS/TS SDKEnvironment variable changes
TAVILY_API_KEY(optional secret) — when absent, falls back to DuckDuckGo+PuppeteerNotes for reviewers
SearchStrategyinterface already supported multiple providers; Tavily slots in cleanlyrawContentas markdown, eliminating the need for Puppeteer-based content extractionAutomated Review
nodejs_compatflag is already present in wrangler.jsonc, so@tavily/core's axios dependency will work in Cloudflare Workers. The logger type unions, bindings declaration, and config additions are all consistent. Three minor issues were found but none block approval.