"""
Embedding-related models
"""

from pydantic import BaseModel, Field
from typing import Optional


class EmbedRequest(BaseModel):
    """Request model for embedding markdown files"""
    directory: str = Field("markdown-data/pages_markdown", description="Directory containing markdown files to embed")
    collection_name: str = Field("mangoit_docs", description="Name of the collection to store embeddings")
    chunk_size: int = Field(500, description="Size of text chunks for embedding")
    chunk_overlap: int = Field(50, description="Overlap between text chunks")


class EmbedResponse(BaseModel):
    """Response model for embedding operation"""
    status: str = Field(..., description="Status of the embedding operation")
    message: str = Field(..., description="Message describing the result")
    documents_embedded: int = Field(0, description="Number of documents embedded")


class EmbedAllRequest(BaseModel):
    """Request model for embedding all markdown files"""
    collection_name: str = Field("mangoit_docs", description="Name of the collection to store embeddings")
    chunk_size: int = Field(1200, description="Size of text chunks for embedding")
    chunk_overlap: int = Field(180, description="Overlap between text chunks")
    embed_backend: str = Field("all-MiniLM-L6-v2", description="Embedding model to use")
    gemini_model: str = Field("gemini-embedding-001", description="Gemini model name if using Gemini")


class EmbedAllResponse(BaseModel):
    """Response model for embedding all markdown files"""
    status: str = Field(..., description="Status of the embedding operation")
    message: str = Field(..., description="Message describing the result")
    pages_embedded: int = Field(0, description="Number of pages embedded")
    posts_embedded: int = Field(0, description="Number of posts embedded")
    total_embedded: int = Field(0, description="Total number of documents embedded")
    embedding_model: str = Field("all-MiniLM-L6-v2", description="Embedding model used")
    collection_name: str = Field("mangoit_docs", description="Collection name used")
