mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-05-24 14:33:26 +00:00
add app settings
This commit is contained in:
parent
b580ac9cd9
commit
08026be5d7
25
src/fastapi_app/lib/app/split_settings/app.py
Normal file
25
src/fastapi_app/lib/app/split_settings/app.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import pydantic
|
||||
import pydantic_settings
|
||||
|
||||
import lib.app.split_settings.utils as app_split_settings_utils
|
||||
|
||||
|
||||
class AppSettings(pydantic_settings.BaseSettings):
|
||||
model_config = pydantic_settings.SettingsConfigDict(
|
||||
env_file=app_split_settings_utils.ENV_PATH,
|
||||
env_prefix="APP_",
|
||||
env_file_encoding="utf-8",
|
||||
extra="ignore",
|
||||
)
|
||||
|
||||
title: str = "FastAPI"
|
||||
version: str = "0.1.0"
|
||||
docs_url: str = "/api/openapi"
|
||||
openapi_url: str = "/api/openapi.json"
|
||||
reload: bool = False
|
||||
|
||||
@pydantic.field_validator("reload")
|
||||
def validate_debug(cls, v: str | bool) -> bool:
|
||||
if isinstance(v, bool):
|
||||
return v
|
||||
return v.lower() == "true"
|
Loading…
Reference in New Issue
Block a user