log-analysis-agent / models.py
Ayushmaan03's picture
1
164acc6
Raw
History Blame Contribute Delete
1 kB
from typing import List, Dict, Literal, Optional, Any
from pydantic import BaseModel
class Action(BaseModel):
action_type: Literal["detect", "classify", "mitigate", "request_more_logs"]
value: Optional[str] = None # e.g., "anomaly", "cpu_spike", "scale_up", or None if requesting logs
class Observation(BaseModel):
logs: List[str]
metrics: Dict[str, float]
timestep: int
max_steps: int
info: str = "" # General feedback/info from the previous step
class State(BaseModel):
"""Full internal state β€” contains ground_truth. Never expose this directly."""
episode_id: str
step_count: int
scenario_name: str
total_reward: float
is_done: bool
ground_truth: Dict[str, str] # Internal only β€” NOT exposed via /state endpoint
class PublicState(BaseModel):
"""Safe state returned by the /state endpoint β€” ground_truth is stripped."""
episode_id: str
step_count: int
scenario_name: str
total_reward: float
is_done: bool