File size: 1,368 Bytes
0c591a7
 
 
 
 
 
 
 
 
95ae0b4
0c591a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d2df6b8
 
 
95ae0b4
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from typing import TypedDict, Optional, List, Any

class AgentState(TypedDict):
    company_name: str
    ticker: Optional[str]  # Stock ticker symbol from search
    strategy_focus: str
    raw_data: Optional[str]
    draft_report: Optional[str]
    critique: Optional[str]
    critique_details: Optional[dict]  # Structured critique for revision loop
    revision_count: int
    score: int
    messages: List[str]
    # Provider tracking
    provider_used: Optional[str]
    data_source: str  # "live" or "mock"
    # MCP source tracking
    sources_failed: Optional[List[str]]  # List of MCP sources that failed
    # LLM provider tracking
    llm_providers_failed: Optional[List[str]]  # List of LLM providers that failed
    # Progress tracking (for granular metrics)
    workflow_id: Optional[str]
    progress_store: Optional[Any]  # Reference to WORKFLOWS dict
    # Error handling - abort workflow on critical failures
    error: Optional[str]  # Set when LLM providers fail, causes workflow to abort
    # Metric reference for hallucination prevention (Layer 1)
    metric_reference: Optional[dict]  # {M01: {key, raw_value, formatted, as_of_date}, ...}
    metric_reference_hash: Optional[str]  # SHA256 hash for integrity verification
    # Revision tracking
    analyzer_revision_skipped: Optional[bool]  # True if revision was skipped due to LLM failure