Spaces:
Runtime error
Runtime error
File size: 968 Bytes
1e8bb26 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | """Application configuration, loaded from environment / .env file."""
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
# Qdrant
qdrant_url: str
qdrant_api_key: str
qdrant_collection: str = "documents"
# MongoDB
mongodb_uri: str
mongodb_db: str = "doc_intelligence_rag"
# LLM via OpenRouter (OpenAI-compatible API)
openrouter_api_key: str = ""
openrouter_base_url: str = "https://openrouter.ai/api/v1"
openrouter_model: str = "anthropic/claude-sonnet-4.6"
# Embeddings (local, ONNX via fastembed — no torch needed)
embedding_model: str = "BAAI/bge-small-en-v1.5"
embedding_dim: int = 384
# Retrieval / chunking
chunk_size: int = 900
chunk_overlap: int = 150
top_k: int = 5
@lru_cache
def get_settings() -> Settings:
return Settings()
|