BuddyMath / domain /schemas.py
dotandru's picture
Fix: Clean production deployment with sse-starlette
9d29c62
raw
history blame
782 Bytes
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