feat(core): add core layer with config, clients, exceptions, models, and app factory
This commit is contained in:
39
src/core/config.py
Normal file
39
src/core/config.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""Application configuration loaded from .env via pydantic-settings."""
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""All environment variables with defaults and validation."""
|
||||
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
|
||||
|
||||
# OpenAI
|
||||
openai_api_key: str
|
||||
embedding_model: str = "text-embedding-3-small"
|
||||
llm_model: str = "gpt-4o-mini"
|
||||
|
||||
# Qdrant
|
||||
qdrant_url: str = "http://localhost:6333"
|
||||
qdrant_api_key: str | None = None
|
||||
|
||||
# Retrieval
|
||||
top_k: int = 5
|
||||
|
||||
# LLM generation
|
||||
temperature: float = 0.0
|
||||
max_tokens: int = 1024
|
||||
|
||||
# Chunking defaults
|
||||
chunk_size: int = 512
|
||||
chunk_overlap: int = 50
|
||||
|
||||
# Semantic chunking
|
||||
semantic_threshold: float = 0.3
|
||||
semantic_min_chunk_size: int = 3
|
||||
|
||||
# Database
|
||||
database_url: str = "sqlite:///./data/chunking_benchmark.db"
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user