第一次提交
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class Settings:
|
||||
api_key: str | None
|
||||
base_url: str
|
||||
model: str
|
||||
default_system_prompt: str
|
||||
data_dir: Path
|
||||
|
||||
@classmethod
|
||||
def from_env(cls) -> "Settings":
|
||||
return cls(
|
||||
api_key=os.getenv("DEEPSEEK_API_KEY"),
|
||||
base_url=os.getenv("DEEPSEEK_BASE_URL", "https://api.deepseek.com"),
|
||||
model=os.getenv("DEEPSEEK_MODEL", "deepseek-v4-flash"),
|
||||
default_system_prompt=os.getenv(
|
||||
"DEFAULT_SYSTEM_PROMPT", "You are a helpful assistant."
|
||||
),
|
||||
data_dir=Path(os.getenv("CHAT_DATA_DIR", "data")),
|
||||
)
|
||||
Reference in New Issue
Block a user