File size: 807 Bytes
223ef32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from typing import TypedDict, List, Dict, Any
from langchain_core.messages import BaseMessage

class AnalysisState(TypedDict):
    # Core data fields
    log_file: str
    raw_logs: str
    prepared_logs: str
    analysis_result: dict
    
    # Timing fields
    start_time: float
    end_time: float
    
    # ReAct agent conversation tracking
    messages: List[BaseMessage]  # Tracks agent thoughts, tool calls, and tool results
    
    # Iterative refinement fields
    iteration_count: int          # Current iteration: 0, 1, or 2
    critic_feedback: str          # Feedback from critic for next iteration
    iteration_history: List[dict] # Track all iterations for debugging/analysis
    
    # Backwards compatibility
    agent_reasoning: str
    agent_observations: List