Implement runtime agent loop and container hygiene
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
"""Configuration management using pydantic-settings."""
|
||||
|
||||
from pydantic import field_validator
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import Optional
|
||||
|
||||
@@ -12,6 +13,30 @@ class Settings(BaseSettings):
|
||||
APP_ENV: str = "development"
|
||||
DEBUG: bool = False
|
||||
|
||||
@field_validator("DEBUG", mode="before")
|
||||
@classmethod
|
||||
def parse_debug(cls, value: object) -> bool:
|
||||
"""Parse permissive runtime DEBUG values from shell environments."""
|
||||
if isinstance(value, bool):
|
||||
return value
|
||||
if isinstance(value, str):
|
||||
normalized = value.strip().lower()
|
||||
if normalized in {"1", "true", "t", "yes", "y", "on", "debug"}:
|
||||
return True
|
||||
if normalized in {
|
||||
"0",
|
||||
"false",
|
||||
"f",
|
||||
"no",
|
||||
"n",
|
||||
"off",
|
||||
"release",
|
||||
"prod",
|
||||
"production",
|
||||
}:
|
||||
return False
|
||||
return False
|
||||
|
||||
# Database
|
||||
DATABASE_URL: str = "postgresql+asyncpg://sanctum:password@localhost:5432/sanctum"
|
||||
|
||||
@@ -27,6 +52,9 @@ class Settings(BaseSettings):
|
||||
LLM_API_KEY: Optional[str] = None
|
||||
LLM_MODEL: str = "gpt-3.5-turbo"
|
||||
|
||||
# Agent loop
|
||||
AGENT_LOOP_INTERVAL_SECONDS: float = 60.0
|
||||
|
||||
# Export
|
||||
EXPORT_PATH: str = "exports"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user