Skip to content

feat: add Tavily web search provider alongside existing providers#178

Open
mani2001 wants to merge 3 commits into
szczyglis-dev:masterfrom
mani2001:feat/tavily-migration/tavily-web-search-provider
Open

feat: add Tavily web search provider alongside existing providers#178
mani2001 wants to merge 3 commits into
szczyglis-dev:masterfrom
mani2001:feat/tavily-migration/tavily-web-search-provider

Conversation

@mani2001
Copy link
Copy Markdown

Summary

  • Added Tavily as a new web search engine provider option in the cmd_web plugin
  • Users can now select Tavily from the provider dropdown alongside Google, Bing, and DuckDuckGo
  • This is an additive change — all existing providers remain untouched

Files Changed

  • src/pygpt_net/provider/web/tavily_search.py (new): TavilySearch(BaseProvider) implementation with id='tavily', search() calling TavilyClient.search(), init_options() exposing tavily_api_key (secret, persist), is_configured() key validation, and get_config_message().
  • src/pygpt_net/app.py: Added import and launcher.add_web(TavilySearch()) registration next to existing web providers.
  • setup.py: Added tavily-python>=0.5.0,<1.0.0 to install_requires.

Dependency Changes

  • Added tavily-python>=0.5.0,<1.0.0 to setup.py install_requires

Environment Variable Changes

  • Added TAVILY_API_KEY — configured via plugin option tavily_api_key (secret/persist) in plugin settings

Notes for Reviewers

  • The tavily import is deferred (inside search() method) to avoid import errors if the package is not yet installed, consistent with lazy-loading patterns
  • The provider follows the same structure and conventions as GoogleCustomSearch, MicrosoftBingSearch, and DuckDuckGoSearch
  • No existing provider code was modified

🤖 Generated with Claude Code

Automated Review

  • Passed after 3 attempt(s)
  • Final review: The Tavily web search provider migration is well-implemented and addresses all three items from the attempt-3 fix list: (1) tavily-python==0.7.23 is correctly added to requirements.txt with a hash (single-hash entries are a normal pattern in this file for packages that publish only one distribution artifact); (2) the limit cap at 20 before computing fetch_count is correct and prevents silent truncation; (3) the tavily_search_depth option is properly wired from init_options() through to client.search(). The provider correctly follows the BaseProvider contract, matches the style of existing providers (DuckDuckGo, Google), and is properly registered in app.py. No regressions, no dead code, no broken imports. Two minor issues noted below but neither blocks 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