feat: pydantic-settings config mit allen env-vars
This commit is contained in:
33
app/config.py
Normal file
33
app/config.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
||||
|
||||
nextcloud_webdav_url: str
|
||||
nextcloud_user: str
|
||||
nextcloud_app_password: str
|
||||
|
||||
ollama_url: str
|
||||
ollama_embed_model: str
|
||||
|
||||
qdrant_url: str
|
||||
qdrant_collection: str
|
||||
|
||||
webhook_secret: str
|
||||
|
||||
ingest_root: str = "Documents/THB/Studium"
|
||||
chunk_size_words: int = 500
|
||||
chunk_overlap_words: int = 50
|
||||
log_level: str = "INFO"
|
||||
|
||||
|
||||
_settings: Settings | None = None
|
||||
|
||||
|
||||
def get_settings() -> Settings:
|
||||
global _settings
|
||||
if _settings is None:
|
||||
_settings = Settings()
|
||||
return _settings
|
||||
Reference in New Issue
Block a user