"""
Configuration for RAG Service
"""

from pydantic_settings import BaseSettings
from typing import Optional


class Settings(BaseSettings):
    """Application settings loaded from environment variables."""

    # Service
    environment: str = "development"
    port: int = 8082

    # Qdrant
    qdrant_url: str = "http://localhost:6333"
    qdrant_collection: str = "legal_documents"

    # Ollama
    ollama_url: str = "http://localhost:11434"
    embedding_model: str = "bge-m3"
    llm_model: str = "qwen2.5:32b"

    # Document Processing
    # NOTE: Changed from 512/50 to 1024/128 for improved retrieval quality.
    # Existing collections (ingested with 512/50) are NOT affected —
    # new settings apply only to new ingestions.
    chunk_size: int = 1024
    chunk_overlap: int = 128

    # Legal Corpus
    corpus_path: str = "./legal-corpus"

    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"
