- 基于 FastAPI 的 Web API 服务 - OpenCode API 客户端封装 - 会话管理器(同步/异步任务执行) - APScheduler 定时任务调度 - 完整的 REST API 端点
20 lines
402 B
Python
20 lines
402 B
Python
from pydantic_settings import BaseSettings
|
|
from pathlib import Path
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
opencode_host: str = "127.0.0.1"
|
|
opencode_port: int = 4096
|
|
opencode_password: str = ""
|
|
|
|
app_host: str = "0.0.0.0"
|
|
app_port: int = 3005
|
|
|
|
data_dir: Path = Path.home() / "Documents" / "XCDesktop" / "xcclaw"
|
|
|
|
class Config:
|
|
env_prefix = "XCCLAW_"
|
|
|
|
|
|
settings = Settings()
|