"""Shared Pydantic request/response models used across route modules."""

from typing import List, Optional
from pydantic import BaseModel


class MoodSetRequest(BaseModel):
    mood: str


class ConversationResetRequest(BaseModel):
    user_id: str


class CustomPromptRequest(BaseModel):
    prompt: str


class ServerConfigRequest(BaseModel):
    guild_id: int
    guild_name: str
    autonomous_channel_id: int
    autonomous_channel_name: str
    bedtime_channel_ids: List[int] = None
    enabled_features: List[str] = None


class EvilMoodSetRequest(BaseModel):
    mood: str


class LogConfigUpdateRequest(BaseModel):
    component: Optional[str] = None
    enabled: Optional[bool] = None
    enabled_levels: Optional[List[str]] = None


class LogFilterUpdateRequest(BaseModel):
    exclude_paths: Optional[List[str]] = None
    exclude_status: Optional[List[int]] = None
    include_slow_requests: Optional[bool] = True
    slow_threshold_ms: Optional[int] = 1000


class BipolarTriggerRequest(BaseModel):
    channel_id: str  # String to handle large Discord IDs from JS
    message_id: str = None  # Optional: starting message ID (string)
    context: str = ""  # Optional: argument theme/context — tells them what to argue about


class ManualCropRequest(BaseModel):
    x: int
    y: int
    width: int
    height: int


class DescriptionUpdateRequest(BaseModel):
    description: str


class AlbumCropRequest(BaseModel):
    x: int
    y: int
    width: int
    height: int


class AlbumDescriptionRequest(BaseModel):
    description: str


class BulkDeleteRequest(BaseModel):
    entry_ids: List[str]


class ChatMessage(BaseModel):
    message: str
    model_type: str = "text"  # "text" or "vision"
    use_system_prompt: bool = True
    image_data: Optional[str] = None  # Base64 encoded image for vision model
    conversation_history: Optional[List[dict]] = None  # Previous messages in conversation
    mood: str = "neutral"  # Miku's mood for this conversation


class MemoryDeleteRequest(BaseModel):
    confirmation: str


class MemoryEditRequest(BaseModel):
    content: str
    metadata: Optional[dict] = None


class MemoryCreateRequest(BaseModel):
    content: str
    collection: str  # 'declarative' or 'episodic'
    user_id: Optional[str] = None
    source: Optional[str] = None
    metadata: Optional[dict] = None
