from __future__ import annotations

from uuid import UUID

from pydantic import BaseModel, Field


class AgentChatRunRequest(BaseModel):
    message: str = Field(min_length=1, max_length=8000)
    session_id: UUID | None = None


class AgentChatEvent(BaseModel):
    type: str
    run_id: str | None = None
    message_id: str | None = None
    delta: str | None = None
    tool_name: str | None = None
    result: str | None = None
    output: str | None = None
    error: str | None = None


class AgentChatRunResponse(BaseModel):
    session_id: UUID
    output: str
    events: list[AgentChatEvent]
