forked from LiveCarta/CommentAutomation
Added settings module
This commit is contained in:
29
src/comment_automation/settings.py
Normal file
29
src/comment_automation/settings.py
Normal file
@@ -0,0 +1,29 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user