fix: 迁移 Pydantic V2 配置方式
This commit is contained in:
@@ -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
BIN
console-screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Reference in New Issue
Block a user