from typing import Any, Dict, List, Optional, TypedDict class FinanceState(TypedDict, total=False): # Core request/response user_query: str response: str trace_id: str # Routing intent: str agents: List[str] # Entities symbol: Optional[str] crypto_symbol: Optional[str] portfolio: Optional[List[Dict[str, Any]]] # Context/state (passed from the UI) conversation_history: List[Dict[str, str]] user_profile: Dict[str, Any] # Optional telemetry/debug retrieved_sources: List[Dict[str, Any]] errors: List[str]