fix: preserve exchange-qualified tickers across agent prompts

This commit is contained in:
CadeYu
2026-03-21 13:10:09 +08:00
parent f362a160c3
commit 08bfe70a69
11 changed files with 91 additions and 24 deletions
@@ -1,9 +1,13 @@
import time
import json
from tradingagents.agents.utils.agent_utils import build_instrument_context
def create_research_manager(llm, memory):
def research_manager_node(state) -> dict:
ticker = state["company_of_interest"]
instrument_context = build_instrument_context(ticker)
history = state["investment_debate_state"].get("history", "")
market_research_report = state["market_report"]
sentiment_report = state["sentiment_report"]
@@ -33,6 +37,8 @@ Take into account your past mistakes on similar situations. Use these insights t
Here are your past reflections on mistakes:
\"{past_memory_str}\"
{instrument_context}
Here is the debate:
Debate History:
{history}"""
@@ -1,11 +1,14 @@
import time
import json
from tradingagents.agents.utils.agent_utils import build_instrument_context
def create_risk_manager(llm, memory):
def risk_manager_node(state) -> dict:
company_name = state["company_of_interest"]
instrument_context = build_instrument_context(company_name)
history = state["risk_debate_state"]["history"]
risk_debate_state = state["risk_debate_state"]
@@ -34,6 +37,8 @@ Deliverables:
- A clear and actionable recommendation: Buy, Sell, or Hold.
- Detailed reasoning anchored in the debate and past reflections.
{instrument_context}
---
**Analysts Debate History:**