fix: 迁移 Pydantic V2 配置方式

This commit is contained in:
2026-03-10 22:59:53 +08:00
parent 7d3bdb8793
commit 5bcfa9effc
2 changed files with 3 additions and 4 deletions

View File

@@ -1,8 +1,10 @@
from pydantic_settings import BaseSettings from pydantic_settings import BaseSettings, SettingsConfigDict
from pathlib import Path from pathlib import Path
class Settings(BaseSettings): class Settings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="XCCLAW_")
opencode_host: str = "127.0.0.1" opencode_host: str = "127.0.0.1"
opencode_port: int = 4096 opencode_port: int = 4096
opencode_password: str = "" opencode_password: str = ""
@@ -12,8 +14,5 @@ class Settings(BaseSettings):
data_dir: Path = Path.home() / "Documents" / "XCDesktop" / "xcclaw" data_dir: Path = Path.home() / "Documents" / "XCDesktop" / "xcclaw"
class Config:
env_prefix = "XCCLAW_"
settings = Settings() settings = Settings()

BIN
console-screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB