fix(settings): fix nested settings load via environment variables (#1551)

Signed-off-by: Alexander Sokolov <alsokoloff@gmail.com>
This commit is contained in:
Alex Sokolov
2025-05-14 14:42:10 +03:00
committed by GitHub
parent 12dab0a1e8
commit 2efb7a7c06
2 changed files with 35 additions and 4 deletions

View File

@@ -56,13 +56,15 @@ class DebugSettings(BaseModel):
class AppSettings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="DOCLING_", env_nested_delimiter="_")
model_config = SettingsConfigDict(
env_prefix="DOCLING_", env_nested_delimiter="_", env_nested_max_split=1
)
perf: BatchConcurrencySettings
debug: DebugSettings
perf: BatchConcurrencySettings = BatchConcurrencySettings()
debug: DebugSettings = DebugSettings()
cache_dir: Path = Path.home() / ".cache" / "docling"
artifacts_path: Optional[Path] = None
settings = AppSettings(perf=BatchConcurrencySettings(), debug=DebugSettings())
settings = AppSettings()