from datetime import datetime

from pydantic import BaseModel


class BrainOverviewOut(BaseModel):
    active_memory_count: int
    important_tag_count: int
    secondary_tag_count: int
    recent_memory_titles: list[str]


class BrainMemoryOut(BaseModel):
    id: str
    memory_type: str
    title: str
    content: str
    importance: int
    confidence: float
    status: str
    created_at: datetime

    model_config = {"from_attributes": True}


class BrainTagOut(BaseModel):
    id: str
    name: str
    category: str
    priority: str
    score: float

    model_config = {"from_attributes": True}


class BrainEventOut(BaseModel):
    id: str
    source_type: str
    source_id: str
    event_type: str
    title: str | None
    content_summary: str | None
    status: str
    created_at: datetime

    model_config = {"from_attributes": True}


class BrainTagGroupsOut(BaseModel):
    important: list[BrainTagOut]
    secondary: list[BrainTagOut]


class BrainLearnRunOut(BaseModel):
    events_considered: int
    candidates_created: int
    memories_promoted: int
