增加工具使用功能

This commit is contained in:
2026-07-03 20:33:22 +08:00
parent 8c05311628
commit 04fefcf488
10 changed files with 662 additions and 71 deletions
+8
View File
@@ -13,6 +13,9 @@ class Settings:
model: str
default_system_prompt: str
data_dir: Path
max_tool_rounds: int = 5
max_tool_calls_per_turn: int = 10
tool_timeout_seconds: float = 5.0
@classmethod
def from_env(cls) -> "Settings":
@@ -26,4 +29,9 @@ class Settings:
"DEFAULT_SYSTEM_PROMPT", "You are a helpful assistant."
),
data_dir=Path(os.getenv("CHAT_DATA_DIR", "data")),
max_tool_rounds=int(os.getenv("MAX_TOOL_ROUNDS", "5")),
max_tool_calls_per_turn=int(
os.getenv("MAX_TOOL_CALLS_PER_TURN", "10")
),
tool_timeout_seconds=float(os.getenv("TOOL_TIMEOUT_SECONDS", "5")),
)