Skip to content

feat: add Tavily as priority search provider with DDG/Google fallback#138

Open
tavily-integrations wants to merge 3 commits into
yym68686:mainfrom
Tavily-FDE:feat/tavily-migration/chatgpt-telegram-bot-search
Open

feat: add Tavily as priority search provider with DDG/Google fallback#138
tavily-integrations wants to merge 3 commits into
yym68686:mainfrom
Tavily-FDE:feat/tavily-migration/chatgpt-telegram-bot-search

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

  • Added Tavily as a configurable, priority search provider for web search queries
  • When TAVILY_API_KEY is set, Tavily is used as the primary search backend
  • Existing Google Custom Search and DuckDuckGo providers are preserved as fallback when Tavily is not configured or returns no results
  • This is an additive change — no existing functionality is removed or altered

Files changed

  • pyproject.toml — Added tavily-python>=0.5.0 to project dependencies
  • .env.example — Added TAVILY_API_KEY env var with documentation comment
  • aient/aient/plugins/websearch.py — Added gettavilysearchurl() function using TavilyClient SDK; modified get_search_url() to prefer Tavily when the API key is present, falling back to Google/DDG otherwise
  • config.py — Added TAVILY_API_KEY environment variable read

Dependency changes

  • Added tavily-python>=0.5.0 to pyproject.toml

Environment variable changes

  • Added TAVILY_API_KEY (optional) — when set, Tavily is used as the primary search provider

Notes for reviewers

  • The gettavilysearchurl() function follows the same error-handling and return pattern as getddgsearchurl() and getgooglesearchurl()
  • Tavily import is done lazily inside the function to avoid import errors when the package is not installed
  • The fallback logic ensures zero disruption to existing deployments without TAVILY_API_KEY

🤖 Generated with Claude Code

Automated Review

  • Passed after 3 attempt(s)
  • Final review: The migration correctly adds Tavily as a configurable, primary search provider with Google/DuckDuckGo as fallback. All required files are updated: pyproject.toml has the dependency, uv.lock resolves tavily-python v0.7.23 with its transitive dependencies (tiktoken, regex), .env.example and README.md document TAVILY_API_KEY, and the aient submodule contains proper integration code using TavilyClient. The implementation is additive and backward-compatible — existing behavior is fully preserved when TAVILY_API_KEY is not set.

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