Skip to content

feat: add Tavily search as configurable alternative to Serper#3

Open
tavily-integrations wants to merge 1 commit into
MiniMax-AI:mainfrom
Tavily-FDE:feat/tavily-migration/serper-search-additive
Open

feat: add Tavily search as configurable alternative to Serper#3
tavily-integrations wants to merge 1 commit into
MiniMax-AI:mainfrom
Tavily-FDE:feat/tavily-migration/serper-search-additive

Conversation

@tavily-integrations

Copy link
Copy Markdown

Summary

Adds Tavily as an optional, configurable search provider alongside the existing Serper integration (additive/parallel strategy). When configured, search queries are routed to Tavily instead of Serper; otherwise the existing Serper path is unchanged.

Changes

minimax_search_browse.py

  • Imported TavilyClient from tavily-python
  • Added search_tavily(query) function that calls TavilyClient.search() and normalizes results to match Serper's shape (title, url, snippet)
  • Added provider-selection logic in get_search_results(): routes to Tavily when SEARCH_PROVIDER=tavily or TAVILY_API_KEY is present; defaults to Serper otherwise

pyproject.toml

  • Added tavily-python>=0.3.0 to dependencies list

Environment Variable Changes

  • TAVILY_API_KEY (new, optional) — activates Tavily search path
  • SEARCH_PROVIDER (new, optional) — set to tavily or serper; defaults to Serper when unset
  • SERPER_API_KEY (existing, unchanged)

Notes for Reviewers

  • Tavily's content field is mapped to snippet in normalized results, which get_brief_text() already handles
  • Existing Serper code paths are completely untouched
  • Provider selection priority: explicit SEARCH_PROVIDER env var > presence of TAVILY_API_KEY > default (Serper)

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily additive migration is functionally correct and well-scoped. The search_tavily() function uses the correct SDK patterns, properly normalizes results to the Serper shape expected by get_brief_text(), and the provider-selection logic in get_search_results() is sensible. The tavily-python>=0.3.0 dependency is correctly added to pyproject.toml. Three minor issues exist but none block approval.

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