diff --git a/tradingagents/agents/managers/risk_manager.py b/tradingagents/agents/managers/risk_manager.py index 9ed03e2d..1f2334cc 100644 --- a/tradingagents/agents/managers/risk_manager.py +++ b/tradingagents/agents/managers/risk_manager.py @@ -11,7 +11,7 @@ def create_risk_manager(llm, memory): risk_debate_state = state["risk_debate_state"] market_research_report = state["market_report"] news_report = state["news_report"] - fundamentals_report = state["news_report"] + fundamentals_report = state["fundamentals_report"] sentiment_report = state["sentiment_report"] trader_plan = state["investment_plan"] diff --git a/tradingagents/graph/propagation.py b/tradingagents/graph/propagation.py index 7aba5258..0fd10c0c 100644 --- a/tradingagents/graph/propagation.py +++ b/tradingagents/graph/propagation.py @@ -24,14 +24,26 @@ class Propagator: "company_of_interest": company_name, "trade_date": str(trade_date), "investment_debate_state": InvestDebateState( - {"history": "", "current_response": "", "count": 0} + { + "bull_history": "", + "bear_history": "", + "history": "", + "current_response": "", + "judge_decision": "", + "count": 0, + } ), "risk_debate_state": RiskDebateState( { + "aggressive_history": "", + "conservative_history": "", + "neutral_history": "", "history": "", + "latest_speaker": "", "current_aggressive_response": "", "current_conservative_response": "", "current_neutral_response": "", + "judge_decision": "", "count": 0, } ), diff --git a/tradingagents/graph/setup.py b/tradingagents/graph/setup.py index 772efe7f..720aaa84 100644 --- a/tradingagents/graph/setup.py +++ b/tradingagents/graph/setup.py @@ -1,7 +1,10 @@ # TradingAgents/graph/setup.py -from typing import Dict, Any +from typing import Any, Dict, Union + from langchain_openai import ChatOpenAI +from langchain_anthropic import ChatAnthropic +from langchain_google_genai import ChatGoogleGenerativeAI from langgraph.graph import END, StateGraph, START from langgraph.prebuilt import ToolNode @@ -10,14 +13,17 @@ from tradingagents.agents.utils.agent_states import AgentState from .conditional_logic import ConditionalLogic +# Union of supported LLM chat model types +ChatModel = Union[ChatOpenAI, ChatAnthropic, ChatGoogleGenerativeAI] + class GraphSetup: """Handles the setup and configuration of the agent graph.""" def __init__( self, - quick_thinking_llm: ChatOpenAI, - deep_thinking_llm: ChatOpenAI, + quick_thinking_llm: ChatModel, + deep_thinking_llm: ChatModel, tool_nodes: Dict[str, ToolNode], bull_memory, bear_memory,