Skip to content

feat: add Tavily search as optional provider in ChuanhuAgent#1196

Open
tavily-integrations wants to merge 1 commit into
GaiZhenbiao:mainfrom
Tavily-FDE:feat/tavily-migration/chuanhu-agent-search
Open

feat: add Tavily search as optional provider in ChuanhuAgent#1196
tavily-integrations wants to merge 1 commit into
GaiZhenbiao:mainfrom
Tavily-FDE:feat/tavily-migration/chuanhu-agent-search

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

  • Added tavily-python dependency to requirements.txt
  • Added TAVILY_API_KEY config field to config_example.json under the ChuanhuAgent section
  • Extended modules/config.py to load TAVILY_API_KEY from config.json into environment
  • Added conditional Tavily search tool registration in ChuanhuAgent.__init__ — when TAVILY_API_KEY is set, a TavilySearchResults tool is appended alongside existing search tools

Files changed

  • requirements.txt — added tavily-python
  • config_example.json — added TAVILY_API_KEY entry
  • modules/config.py — added TAVILY_API_KEY to env loading loop
  • modules/models/ChuanhuAgent.py — conditional Tavily tool registration

Dependency changes

  • Added tavily-python to requirements.txt

Environment variable changes

  • Added TAVILY_API_KEY (read from config.json or environment)

Notes for reviewers

  • This is an additive change — all existing search providers (DuckDuckGo, Google CSE, SerpAPI) are untouched
  • Tavily tool uses langchain_community.tools.tavily_search.TavilySearchResults which reads TAVILY_API_KEY from the environment
  • Import is wrapped in try/except to gracefully handle missing dependencies

🤖 Generated with Claude Code

Automated Review

  • Passed after 1 attempt(s)
  • Final review: The Tavily migration for chuanhu-agent-search is well-implemented and additive. All four reported files are correctly modified: tavily-python is added to requirements.txt, TAVILY_API_KEY is documented in config_example.json, the key is propagated to the environment in config.py (consistent with other API keys), and ChuanhuAgent.py adds the tool with a lazy import inside try/except. Existing search providers are untouched. No regressions, no dead code, no unrelated changes.

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