Skip to content

feat: add Tavily search provider to config and API layer#6

Open
tavily-integrations wants to merge 2 commits into
Amitkrpaliwal:mainfrom
Tavily-FDE:feat/tavily-migration/config-api-tavily-support
Open

feat: add Tavily search provider to config and API layer#6
tavily-integrations wants to merge 2 commits into
Amitkrpaliwal:mainfrom
Tavily-FDE:feat/tavily-migration/config-api-tavily-support

Conversation

@tavily-integrations

Copy link
Copy Markdown

Summary

Adds Tavily as a configurable search provider alongside existing providers (SearXNG, Brave, SerpAPI, DuckDuckGo). This is an additive change — no existing provider logic is removed or modified.

What changed

  • server/src/services/ConfigManager.ts: Extended AppConfig.search.preferred_provider union type to include 'tavily'; added tavily_api_key: string field with empty-string default.
  • server/src/routes/searchRoutes.ts: Accept tavily_api_key in POST /api/search/providers/config body; call configureProvider('tavily', ...) when provided; added 'tavily' to the priority maps for both preferred-provider promotion and auto-mode default priorities.
  • server/src/index.ts: On startup, read TAVILY_API_KEY from env (or saved config) and call configureProvider('tavily', { apiKey, enabled: true }); added 'tavily' to the preferred-provider priority bump map.
  • .env.example: Added TAVILY_API_KEY= entry under the Web Search section.

Files changed

  • server/src/services/ConfigManager.ts
  • server/src/routes/searchRoutes.ts
  • server/src/index.ts
  • .env.example

Dependency changes

None — Tavily provider implementation (SDK dependency) is handled in a separate migration unit.

Environment variable changes

  • Added TAVILY_API_KEY reference in .env.example and startup config loading

Notes for reviewers

  • All pre-existing TypeScript errors are unrelated to these changes (verified via tsc --noEmit).
  • The actual Tavily search provider implementation (SDK integration) is expected in a separate migration unit — this unit only wires the config/API plumbing.

Automated Review

  • Passed after 2 attempt(s)
  • Final review: The config-api-tavily-support unit is well-implemented. All four changed files (ConfigManager.ts, searchRoutes.ts, index.ts, .env.example) are consistent and correct. The Tavily priority of 3 in the auto-reset block matches the canonical order from the prerequisite unit (searxng=1, tavily=3, serpapi=5, brave=10, duckduckgo=100). The as string cast in index.ts is valid since the enclosing condition guarantees a truthy value. No regressions, no dead code, and no unintended changes were found.

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