feat: AI Worker 平台 MVP v1.0.0 - 多租户/项目管理/AI Worker/任务编排/HITL审核/成本治理

This commit is contained in:
2026-08-12 13:30:36 +08:00
parent 7a6b467dad
commit 79b7f5f579
+43
View File
@@ -0,0 +1,43 @@
"""Application configuration."""
from typing import List
from pydantic_settings import BaseSettings
from pydantic import field_validator
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
# App
APP_NAME: str = "AI Worker Platform"
APP_VERSION: str = "1.0.0"
SECRET_KEY: str = "dev-secret-key-change-in-production"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 1440 # 24 hours
# Database
DATABASE_URL: str = "sqlite:///./ai_worker.db"
# Redis
REDIS_URL: str = ""
# LLM Defaults
DEFAULT_LLM_PROVIDER: str = "openai"
DEFAULT_LLM_API_KEY: str = ""
DEFAULT_LLM_BASE_URL: str = "https://api.openai.com/v1"
DEFAULT_LLM_MODEL: str = "gpt-4o-mini"
# CORS
CORS_ORIGINS: str = "http://localhost:5173,http://localhost:3000"
@field_validator("CORS_ORIGINS")
@classmethod
def parse_cors(cls, v: str) -> str:
return v
@property
def cors_origins_list(self) -> List[str]:
return [o.strip() for o in self.CORS_ORIGINS.split(",") if o.strip()]
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
settings = Settings()