Skip to content

feat: add Tavily as opt-in search/extract provider#2

Open
tavily-integrations wants to merge 1 commit into
nipuxx:mainfrom
Tavily-FDE:feat/tavily-migration/nipux-cli-web-search
Open

feat: add Tavily as opt-in search/extract provider#2
tavily-integrations wants to merge 1 commit into
nipuxx:mainfrom
Tavily-FDE:feat/tavily-migration/nipux-cli-web-search

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

Adds Tavily as a configurable alternative to the default DuckDuckGo HTML scraper for web_search and web_extract tools. This is an additive change — DuckDuckGo remains the default; Tavily is purely opt-in via config.

What changed

  • nipux_cli/web.py — Refactored web_search/web_extract into _ddg_search/_ddg_extract (DuckDuckGo) and added _tavily_search/_tavily_extract (Tavily SDK). Public functions now accept a search_provider parameter and dispatch accordingly.
  • nipux_cli/config.py — Added search_provider: str field to ToolAccessConfig (default "duckduckgo"). load_config() reads tools.search_provider from YAML. Updated default_config_yaml() template.
  • nipux_cli/tools.py_web_call now reads ctx.config.tools.search_provider and passes it to the web dispatch layer (removed unused del ctx).
  • pyproject.toml — Added tavily-python>=0.5.0 to dependencies.
  • config.example.yaml — Documented search_provider option under tools.
  • .env.example — Added TAVILY_API_KEY placeholder.

How to enable

  1. Set TAVILY_API_KEY in ~/.nipux/.env
  2. Add search_provider: tavily under tools: in config.yaml

Files changed

  • nipux_cli/web.py
  • nipux_cli/config.py
  • nipux_cli/tools.py
  • pyproject.toml
  • config.example.yaml
  • .env.example

Notes for reviewers

  • Tavily client is lazily imported only when the provider is selected, so there is no startup cost when using DuckDuckGo.
  • All existing DuckDuckGo behavior is preserved unchanged.

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The migration cleanly adds Tavily as a configurable search provider alongside DuckDuckGo. The implementation is additive and correct: public functions web_search/web_extract are preserved with backward-compatible signatures, provider dispatch is clean, config threading through ToolContext is correct, TavilyClient() auto-reads TAVILY_API_KEY from the environment as expected, and existing tests remain valid since the new search_provider parameter defaults to "duckduckgo". All six reportedly changed files are accounted for in the diff. No regressions 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