from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    # App
    APP_NAME: str = "Clew API"
    APP_VERSION: str = "0.1.0"

    # Qdrant
    QDRANT_HOST: str = "localhost"
    QDRANT_PORT: int = 6335  # Match ingestion default port
    QDRANT_COLLECTION: str = "codebase"

    # Neo4j
    NEO4J_URI: str = "bolt://localhost:7687"
    NEO4J_USER: str | None = None
    NEO4J_PASSWORD: str | None = None

    # Embeddings
    EMBEDDING_DIMENSION: int = 1536

    # OpenAI
    OPENAI_EMBEDDING_MODEL: str = "text-embedding-3-large"

    # Ollama
    OLLAMA_EMBEDDING_MODEL: str = "nomic-embed-text"
    OLLAMA_TIMEOUT: float = 10.0

    model_config = SettingsConfigDict(
        env_file=".env",
        extra="ignore",  # Allow extra environment variables without failing
        env_ignore_empty=True,
    )


settings = Settings()
