TradingAgents/tradingagents/agents
Copilot 1362781291
feat: improve Industry Deep Dive report quality with enriched data, sector routing, and tool-call nudge
* Initial plan

* Improve Industry Deep Dive quality: enrich tool data, explicit sector keys, tool-call nudge

- Enrich get_industry_performance_yfinance with 1-day/1-week/1-month price returns
  via batched yf.download() for top 10 tickers (Step 1)
- Add VALID_SECTOR_KEYS, _DISPLAY_TO_KEY, _extract_top_sectors() to industry_deep_dive.py
  to pre-extract top sectors from Phase 1 report and inject them into the prompt (Step 2)
- Add tool-call nudge to run_tool_loop: if first LLM response has no tool calls and is
  under 500 chars, re-prompt with explicit instruction to call tools (Step 3)
- Update scanner_tools.py get_industry_performance docstring to list all valid sector keys (Step 4)
- Add 15 unit tests covering _extract_top_sectors, tool_runner nudge, and enriched output (Step 5)

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

* Address code review: move cols[3] access into try block for IndexError safety

Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>

* fix: align display row count with download count in get_industry_performance_yfinance

The enriched function downloads price data for top 10 tickers but displayed
20 rows, causing rows 11-20 to show N/A in all price columns. This broke
test_industry_perf_falls_back_to_yfinance which asserts N/A count < 5.
Now both download and display use head(10) for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aguzererler <6199053+aguzererler@users.noreply.github.com>
Co-authored-by: Ahmet Guzererler <guzererler@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 20:10:45 +01:00
..
analysts fix: improve data vendor implementations and tool signatures 2026-02-03 22:27:20 +00:00
managers fix(risk_manager): 修复基本面报告数据源错误 2026-02-09 18:21:21 +08:00
researchers chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
risk_mgmt refactor: rename risky/safe agents to aggressive/conservative 2026-02-03 22:27:20 +00:00
scanners feat: improve Industry Deep Dive report quality with enriched data, sector routing, and tool-call nudge 2026-03-17 20:10:45 +01:00
trader Fix: Prevent infinite loops, enable reflection, and improve logging 2025-07-03 17:43:40 +05:00
utils feat: improve Industry Deep Dive report quality with enriched data, sector routing, and tool-call nudge 2026-03-17 20:10:45 +01:00
__init__.py refactor: rename risky/safe agents to aggressive/conservative 2026-02-03 22:27:20 +00:00