File size: 782 Bytes
9d29c62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from enum import Enum
from typing import Optional, Any, Dict
from pydantic import BaseModel, Field

class BuddyState(str, Enum):
    STRATEGY_READY = "STRATEGY_READY"
    SECTION_WORKING = "SECTION_WORKING"
    SECTION_READY = "SECTION_READY"
    COMPLETE = "COMPLETE"
    ERROR = "ERROR"

class BuddyEvent(BaseModel):
    question_id: str = Field(..., description="Unique ID for the question session")
    state: BuddyState = Field(..., description="Current state of the micro-agent")
    current_section_id: Optional[str] = Field(None, description="The ID of the section (e.g., 'א', 'ב') currently being processed")
    payload: Dict[str, Any] = Field(default_factory=dict, description="Payload containing state-specific data")

    class Config:
        use_enum_values = True