Files
workphone-sdk/sdk/app/config.py

45 lines
1.0 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 # 秒,发消息专用(可配置,避免无限挂起)
class Config:
env_file = ".env"
extra = "ignore"
settings = Settings()