Skip to content

feat: add Tavily news vendor to tradingagents dataflow fallback chain#3

Open
tavily-integrations wants to merge 2 commits into
samuelvinay91:mainfrom
Tavily-FDE:feat/tavily-migration/tradingagents-news-dataflow
Open

feat: add Tavily news vendor to tradingagents dataflow fallback chain#3
tavily-integrations wants to merge 2 commits into
samuelvinay91:mainfrom
Tavily-FDE:feat/tavily-migration/tradingagents-news-dataflow

Conversation

@tavily-integrations
Copy link
Copy Markdown

Summary

  • Added Tavily as a third news data vendor alongside Alpha Vantage and yFinance in the tradingagents/dataflows/ pipeline
  • Created tavily_news.py with get_news_tavily() and get_global_news_tavily() using the Tavily search API (topic="news")
  • Registered Tavily functions in VENDOR_METHODS for get_news and get_global_news in interface.py
  • Added "tavily" to VENDOR_LIST so it participates in the existing fallback routing

Files changed

  • tradingagents/dataflows/tavily_news.py (new) — Tavily news fetch functions
  • tradingagents/dataflows/interface.py — import + register Tavily vendor
  • requirements.txt — added tavily-python>=0.5.0
  • .env.example — added TAVILY_API_KEY and SKOPAQ_TAVILY_API_KEY

Dependency changes

  • Added tavily-python>=0.5.0 to requirements.txt

Env var changes

  • Added TAVILY_API_KEY and SKOPAQ_TAVILY_API_KEY to .env.example

Notes for reviewers

  • This is an additive change — Alpha Vantage and yFinance remain untouched
  • Tavily is only activated when listed in the data_vendors.news_data config key or tool_vendors map
  • The existing route_to_vendor() fallback mechanism handles Tavily transparently
  • Output format matches the string format used by the yFinance news functions

🤖 Generated with Claude Code

Automated Review

  • Passed after 2 attempt(s)
  • Final review: The Tavily news dataflow migration is correct and complete. The implementation adds tavily_news.py with sync TavilyClient (appropriate for this synchronous routing context), registers both functions in interface.py's vendor registry, adds comprehensive unit tests, updates requirements.txt, and documents env vars in .env.example. No regressions are introduced — the lazy TavilyClient import inside _get_tavily_client() means interface.py's top-level import is safe even without the package installed. One minor inconsistency: env_bridge.py is not updated to bridge SKOPAQ_TAVILY_API_KEYTAVILY_API_KEY (unlike all other provider keys), but .env.example explicitly documents TAVILY_API_KEY= as a direct env var, and the approved scanner-news-screener prerequisite uses the same pattern.

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