mirror of
https://github.com/TauricResearch/TradingAgents.git
synced 2026-06-16 21:06:15 +03:00
Clear the deferred full-repo lint backlog so the whole tree passes the strict ruff select (E,W,F,I,B,UP,C4,SIM). Mechanical fixes dominate: import sorting, pep585/604 annotations, dropped dead imports, and whitespace. The few semantic changes are behavior-preserving: declare __all__ on the agent_utils and alpha_vantage re-export hubs; expand 'from x import *' to explicit names; use immutable tuple defaults instead of mutable list defaults; contextlib.suppress for try/except/pass; and narrow an over-broad assertRaises.
77 lines
3.2 KiB
Python
77 lines
3.2 KiB
Python
from typing import Annotated
|
|
|
|
from langgraph.graph import MessagesState
|
|
from typing_extensions import TypedDict
|
|
|
|
|
|
# Researcher team state
|
|
class InvestDebateState(TypedDict):
|
|
bull_history: Annotated[
|
|
str, "Bullish Conversation history"
|
|
] # Bullish Conversation history
|
|
bear_history: Annotated[
|
|
str, "Bearish Conversation history"
|
|
] # Bullish Conversation history
|
|
history: Annotated[str, "Conversation history"] # Conversation history
|
|
current_response: Annotated[str, "Latest response"] # Last response
|
|
judge_decision: Annotated[str, "Final judge decision"] # Last response
|
|
count: Annotated[int, "Length of the current conversation"] # Conversation length
|
|
|
|
|
|
# Risk management team state
|
|
class RiskDebateState(TypedDict):
|
|
aggressive_history: Annotated[
|
|
str, "Aggressive Agent's Conversation history"
|
|
] # Conversation history
|
|
conservative_history: Annotated[
|
|
str, "Conservative Agent's Conversation history"
|
|
] # Conversation history
|
|
neutral_history: Annotated[
|
|
str, "Neutral Agent's Conversation history"
|
|
] # Conversation history
|
|
history: Annotated[str, "Conversation history"] # Conversation history
|
|
latest_speaker: Annotated[str, "Analyst that spoke last"]
|
|
current_aggressive_response: Annotated[
|
|
str, "Latest response by the aggressive analyst"
|
|
] # Last response
|
|
current_conservative_response: Annotated[
|
|
str, "Latest response by the conservative analyst"
|
|
] # Last response
|
|
current_neutral_response: Annotated[
|
|
str, "Latest response by the neutral analyst"
|
|
] # Last response
|
|
judge_decision: Annotated[str, "Judge's decision"]
|
|
count: Annotated[int, "Length of the current conversation"] # Conversation length
|
|
|
|
|
|
class AgentState(MessagesState):
|
|
company_of_interest: Annotated[str, "Company that we are interested in trading"]
|
|
asset_type: Annotated[str, "Asset type under analysis such as stock or crypto"]
|
|
instrument_context: Annotated[str, "Deterministic ticker identity resolved at run start"]
|
|
trade_date: Annotated[str, "What date we are trading at"]
|
|
|
|
sender: Annotated[str, "Agent that sent this message"]
|
|
|
|
# research step
|
|
market_report: Annotated[str, "Report from the Market Analyst"]
|
|
sentiment_report: Annotated[str, "Report from the Sentiment Analyst"]
|
|
news_report: Annotated[
|
|
str, "Report from the News Researcher of current world affairs"
|
|
]
|
|
fundamentals_report: Annotated[str, "Report from the Fundamentals Researcher"]
|
|
|
|
# researcher team discussion step
|
|
investment_debate_state: Annotated[
|
|
InvestDebateState, "Current state of the debate on if to invest or not"
|
|
]
|
|
investment_plan: Annotated[str, "Plan generated by the Analyst"]
|
|
|
|
trader_investment_plan: Annotated[str, "Plan generated by the Trader"]
|
|
|
|
# risk management team discussion step
|
|
risk_debate_state: Annotated[
|
|
RiskDebateState, "Current state of the debate on evaluating risk"
|
|
]
|
|
final_trade_decision: Annotated[str, "Final decision made by the Risk Analysts"]
|
|
past_context: Annotated[str, "Memory log context injected at run start (same-ticker decisions + cross-ticker lessons)"]
|