feat(i18n): localize researchers, risk debators, research mgr, trader

output_language config now propagates to every user-facing agent.
Previously only the four analysts and portfolio manager respected
the setting, producing partial-localization reports with English
debate text interleaved with non-English analyst sections. Verified
live: 7 agents produce Chinese output when config is set to Chinese.

#575
This commit is contained in:
Yijia-Xiao committed 2026-05-11 05:41:42 +00:00
1 parent 384fe1a3d2
commit 6b384f74f9
8 files changed
+24 -10

No files matched your search

+4 -2
View File
@@ -24,8 +24,10 @@ def get_language_instruction() -> str:
"""Return a prompt instruction for the configured output language.
Returns empty string when English (default), so no extra tokens are used.
Only applied to user-facing agents (analysts, portfolio manager).
Internal debate agents stay in English for reasoning quality.
Applied to every agent whose output reaches the saved report —
analysts, researchers, debaters, research manager, trader, and
portfolio manager — so a non-English run produces a fully localized
report rather than a mix of languages.
"""
from tradingagents.dataflows.config import get_config
lang = get_config().get("output_language", "English")