Add Tavily option for deep-research-exa-additive#7
Open
evanYDL wants to merge 1 commit intocodebucks27:mainfrom
Open
Add Tavily option for deep-research-exa-additive#7evanYDL wants to merge 1 commit intocodebucks27:mainfrom
evanYDL wants to merge 1 commit intocodebucks27:mainfrom
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.
Search Provider Migration: deep-research-exa-additive
Adds Tavily as an additional option while preserving existing provider behavior.
Introduces Tavily, a search API optimized for LLM applications.
Changes
All changes are complete and consistent. Here's a summary:
Changes Made
1.
src/app/api/deep-research/services.tsimport { tavily } from "@tavily/core"getTavily()function mirroring the existinggetExa()pattern — creates a Tavily client on first call usingTAVILY_API_KEYenv var2.
src/app/api/deep-research/research-functions.tsgetTavilyto imports from./servicessearchWithExa()helpersearchWithTavily()helper that callsclient.search()withsearchDepth: "advanced",maxResults: MAX_SEARCH_RESULTS, andexcludeDomains: ["youtube.com"]; filters results byscore > 0and maps to the sharedSearchResultshapesearch()to branch onSEARCH_PROVIDERenv var:"exa"(default) — uses Exa as before"tavily"— uses Tavily"both"— runs both in parallel viaPromise.all, merges and deduplicates by URL3.
package.json"@tavily/core": "^0.0.7"to dependencies (keptexa-js)4.
.env.exampleTAVILY_API_KEY='add your tavily api key here'SEARCH_PROVIDER='exa'with comment documenting options:exa | tavily | bothEXA_SEARCH_API_KEY