forked from LiveCarta/CommentAutomation
30 lines
940 B
Python
30 lines
940 B
Python
from pydantic import Field
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class AppSettings(BaseSettings):
|
|
model_config = SettingsConfigDict(extra="ignore")
|
|
|
|
celery_broker_url: str = Field(
|
|
default="redis://localhost:6379/0", alias="CELERY_BROKER_URL"
|
|
)
|
|
celery_result_backend: str = Field(
|
|
default="redis://localhost:6379/0",
|
|
alias="CELERY_RESULT_BACKEND",
|
|
)
|
|
|
|
llm_endpoint_url: str | None = Field(default=None, alias="LLM_ENDPOINT_URL")
|
|
llm_endpoint_api_key: str | None = Field(default=None, alias="LLM_ENDPOINT_API_KEY")
|
|
llm_endpoint_timeout_seconds: float = Field(
|
|
default=10.0,
|
|
alias="LLM_ENDPOINT_TIMEOUT_SECONDS",
|
|
gt=0,
|
|
)
|
|
|
|
http_log_level: str = Field(default="INFO", alias="HTTP_LOG_LEVEL")
|
|
celery_log_level: str = Field(default="INFO", alias="CELERY_LOG_LEVEL")
|
|
|
|
|
|
def get_settings() -> AppSettings:
|
|
return AppSettings()
|