Skip to content

feat: migrate core internet search to support Tavily provider#3

Open
tavily-integrations wants to merge 1 commit into
gonicolas12:mainfrom
Tavily-FDE:feat/tavily-migration/core-internet-search
Open

feat: migrate core internet search to support Tavily provider#3
tavily-integrations wants to merge 1 commit into
gonicolas12:mainfrom
Tavily-FDE:feat/tavily-migration/core-internet-search

Conversation

@tavily-integrations

Copy link
Copy Markdown

Summary

  • Added Tavily as an optional, highest-priority search provider in EnhancedInternetSearchEngine
  • When TAVILY_API_KEY env var is set and tavily-python is installed, Tavily is used as the first search method; existing DuckDuckGo/Google/Brave providers remain as fallbacks
  • Added _search_tavily() method using the Tavily Python SDK with search_depth="basic" for fast results

Files changed

  • models/internet_search.py — Added os import, optional tavily import, Tavily client init in __init__, _search_tavily() method, and wired it as priority 0 in _perform_search()
  • requirements.txt — Added tavily-python>=0.5.0
  • config.yaml — Added tavily server block under mcp.servers with TAVILY_API_KEY env var reference

Dependency changes

  • Added tavily-python>=0.5.0 to requirements.txt

Environment variable changes

  • Added TAVILY_API_KEY (optional; when set, enables Tavily as the primary search provider)

Notes for reviewers

  • This is an additive migration: no existing provider code was modified or removed
  • Tavily import is wrapped in try/except so the app works without tavily-python installed
  • The Tavily client is only initialized when both the SDK is available AND the API key is set

🤖 Generated with Claude Code

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration for core-internet-search is well-implemented and correct. The additive strategy is properly executed: Tavily is prepended as PRIORITÉ 0 only when TAVILY_API_KEY is set and tavily-python is installed, with all existing providers (DuckDuckGo, Cloudscraper, SearXNG, etc.) remaining unchanged as fallbacks. SDK usage is valid — TavilyClient initialization, search() call parameters, and response field mapping (content→snippet, title, url) are all correct per Tavily's API. Dependencies are updated in requirements.txt and the env var is documented in config.yaml. No regressions introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant