|
from typing import TypedDict, Dict, Any, List, Optional, Annotated |
|
import operator |
|
|
|
|
|
class AgentState(TypedDict): |
|
|
|
portfolio_data: Dict[str, Any] |
|
risk_level: str |
|
investment_goals: str |
|
|
|
|
|
technical_analysis: Dict[str, Any] |
|
news_analysis: List[Dict[str, Any]] |
|
fundamental_analysis: Dict[str, Any] |
|
|
|
|
|
rag_context: Optional[str] |
|
|
|
|
|
messages: Annotated[List[Dict[str, Any]], operator.add] |
|
|
|
|
|
recommendations: List[Dict[str, str]] |
|
portfolio_strengths: List[str] |
|
portfolio_weaknesses: List[str] |
|
new_investments: List[Dict[str, Any]] |
|
allocation_advice: str |
|
risk_assessment: str |
|
final_report: str |
|
|
|
|
|
|
|
class AgentState2(TypedDict): |
|
|
|
portfolio_data: Dict[str, Any] |
|
risk_level: str |
|
investment_goals: str |
|
|
|
|
|
technical_analysis: Dict[str, Any] |
|
news_analysis: List[Dict[str, Any]] |
|
fundamental_analysis: Dict[str, Any] |
|
|
|
|
|
high_rank_stocks: List[Dict[str, Any]] |
|
new_stock_analysis: Dict[str, Any] |
|
portfolio_fit: Dict[str, Any] |
|
|
|
|
|
rag_context: Optional[str] |
|
|
|
|
|
messages: Annotated[List[Dict[str, Any]], operator.add] |
|
|
|
|
|
recommendations: List[Dict[str, str]] |
|
portfolio_strengths: List[str] |
|
portfolio_weaknesses: List[str] |
|
new_investments: List[Dict[str, Any]] |
|
new_investment_summary: str |
|
allocation_advice: str |
|
risk_assessment: str |
|
final_report: str |