增加工具使用功能

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
+4
View File
@@ -14,6 +14,7 @@ from models import (
)
from service import ChatProviderError, ChatService
from storage import JsonSessionStorage, SessionNotFoundError, SessionStorageError
from tools import ToolRegistry
def create_app(
@@ -37,6 +38,9 @@ def create_app(
storage=storage,
client=resolved_client,
model=resolved_settings.model,
tool_registry=ToolRegistry(resolved_settings.tool_timeout_seconds),
max_tool_rounds=resolved_settings.max_tool_rounds,
max_tool_calls_per_turn=resolved_settings.max_tool_calls_per_turn,
)
yield
if client is None: