Files
workphone-sdk/sdk/app/config.py
卡若 9118df9eee
Some checks failed
SDK CI / python-compile (push) Has been cancelled
feat: sdk agent、Android 与文档同步至 Gitea
- 新增 sdk/app/agent(Hook/Skills/Anti-ban 等)及 NAS/ADB 脚本
- 更新 Android 端、unified、PHP SDK、Docker Compose
- Soul 文档迁移至 Soul调研/;移除资料目录内 APK
- .gitignore 排除 sdk/tmp、sdk/logs、sdk/tmp_rom

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 18:20:14 +08:00

50 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
工作手机SDK v3.0 - 配置管理
"""
from pydantic_settings import BaseSettings
from typing import Optional
class Settings(BaseSettings):
"""应用配置"""
# 环境
ENV: str = "development"
DEBUG: bool = True
# API密钥
API_KEY: str = "workphone-secret-key"
# MongoDB
MONGO_URI: str = "mongodb://localhost:27017"
MONGO_DB: str = "workphone_sdk"
# Redis
REDIS_URL: str = "redis://localhost:6379/1"
# AI Agent
DEEPSEEK_API_KEY: Optional[str] = None
DEEPSEEK_BASE_URL: str = "https://api.deepseek.com/v1"
DEEPSEEK_MODEL: str = "deepseek-chat"
# WebSocket需求5s/10s 可配置)
WS_HEARTBEAT_INTERVAL: int = 10 # 秒,支持 5/10/30
WS_TIMEOUT: int = 60 # 秒
# 设备命令
COMMAND_TIMEOUT: int = 30 # 秒,通用指令等待
MESSAGE_SEND_TIMEOUT: int = 60 # 秒,发消息专用(可配置,避免无限挂起)
WECHAT_BACKEND_ONLY: bool = True # 微信动作仅允许后端 Hook不允许 UI 通道回退
# AI 心跳任务队列0 表示无上限(每周期抽空队列 / 队列不截断)
AI_HEARTBEAT_TASK_BATCH: int = 0
AI_HEARTBEAT_QUEUE_MAXLEN: int = 0
class Config:
env_file = ".env"
extra = "ignore"
settings = Settings()