fix: align report paths and improve node name mapping for live streaming
- update portfolio summary route to check 'summary/' directory for scan results - enhance LangGraph event mapping to extract functional node names from metadata - fix initial state keys for ScannerGraph to match TradingAgents internals
This commit is contained in:
parent
d5df6b93a4
commit
c9e5e8989f
|
|
@ -17,22 +17,21 @@ class LangGraphEngine:
|
||||||
"""Run the 3-phase macro scanner and stream events."""
|
"""Run the 3-phase macro scanner and stream events."""
|
||||||
date = params.get("date", time.strftime("%Y-%m-%d"))
|
date = params.get("date", time.strftime("%Y-%m-%d"))
|
||||||
|
|
||||||
# Initialize ScannerGraph
|
# Initialize ScannerGraph correctly
|
||||||
# Note: ScannerGraph in TradingAgents seems to take date and config
|
scanner = ScannerGraph(config=self.config)
|
||||||
scanner = ScannerGraph(date=date, config=self.config)
|
|
||||||
|
|
||||||
print(f"Engine: Starting SCAN {run_id} for date {date}")
|
print(f"Engine: Starting SCAN {run_id} for date {date}")
|
||||||
|
|
||||||
# Initial state for scanner
|
# Initial state for scanner - must match ScannerGraph.scan's initial_state keys
|
||||||
# Based on tradingagents/graph/scanner_graph.py
|
|
||||||
initial_state = {
|
initial_state = {
|
||||||
"date": date,
|
"scan_date": date,
|
||||||
|
"messages": [],
|
||||||
"geopolitical_report": "",
|
"geopolitical_report": "",
|
||||||
"market_movers_report": "",
|
"market_movers_report": "",
|
||||||
"sector_report": "",
|
"sector_performance_report": "",
|
||||||
"industry_deep_dive_report": "",
|
"industry_deep_dive_report": "",
|
||||||
"macro_synthesis_report": "",
|
"macro_scan_summary": "",
|
||||||
"top_10_watchlist": []
|
"sender": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
async for event in scanner.graph.astream_events(initial_state, version="v2"):
|
async for event in scanner.graph.astream_events(initial_state, version="v2"):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue