feat: jc 引擎主线搬入 app/engine(315 测试基线全绿:320 去掉 admin 5 用例)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
APP_HOST: str = "0.0.0.0"
|
||||
APP_PORT: int = 8000
|
||||
APP_DEBUG: bool = False
|
||||
|
||||
AI_PROVIDER: str = "glm"
|
||||
ZHIPU_API_KEY: str = ""
|
||||
# 留空=用 SDK 默认地址(标准套餐 https://open.bigmodel.cn/api/paas/v4)
|
||||
# coding 套餐填 https://open.bigmodel.cn/api/coding/paas/v4
|
||||
ZHIPU_BASE_URL: str = ""
|
||||
AI_MODEL: str = "glm-4-flash"
|
||||
|
||||
DATABASE_URL: str = "sqlite+aiosqlite:///./data/hesupipe_ai_kefu.db"
|
||||
|
||||
SMTP_HOST: str = ""
|
||||
SMTP_PORT: int = 465
|
||||
SMTP_USER: str = ""
|
||||
SMTP_PASS: str = ""
|
||||
NOTIFY_EMAIL: str = ""
|
||||
|
||||
# 询盘推送 UniService(docs/superpowers/specs/2026-09-28-lead-push-to-uniservice-design.md)
|
||||
PUSH_ENABLED: bool = False
|
||||
PUSH_API_URL: str = "https://uniservice.server.hnxinyouhe.com/open/v1/inquiry/push"
|
||||
PUSH_API_KEY: str = ""
|
||||
PUSH_EXTERNAL_KEY_PREFIX: str = "ai-kefu-jc"
|
||||
PUSH_TIMEOUT_SECONDS: float = 10.0
|
||||
PUSH_MAX_ATTEMPTS: int = 3
|
||||
PUSH_RETRY_BACKOFF_BASE: float = 1.0 # 尝试间隔 1s/2s(3 次尝试、2 次间隔)
|
||||
|
||||
ADMIN_PASSWORD: str = "admin123"
|
||||
|
||||
model_config = {
|
||||
"env_file": ".env",
|
||||
"env_file_encoding": "utf-8",
|
||||
}
|
||||
|
||||
|
||||
# app/engine/config.py 比 jc 的 app/config.py 深一层,多退一级才到项目根
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent.parent
|
||||
DATA_DIR = BASE_DIR / "data"
|
||||
STATIC_DIR = BASE_DIR / "static"
|
||||
|
||||
settings = Settings()
|
||||
|
||||
|
||||
def ensure_dirs():
|
||||
DATA_DIR.mkdir(exist_ok=True)
|
||||
Reference in New Issue
Block a user