feat(data-models): 使用 __slots__ 优化内存占用和属性访问性能,更新多个数据模型

This commit is contained in:
Windpicker-owo
2025-12-01 19:57:33 +08:00
parent e72f39c42b
commit 943c2a6566
12 changed files with 175 additions and 63 deletions

View File

@@ -15,7 +15,7 @@ from src.common.logger import get_logger
logger = get_logger("stream_tool_history")
@dataclass
@dataclass(slots=True)
class ToolCallRecord:
"""工具调用记录"""
tool_name: str

View File

@@ -17,7 +17,7 @@ from src.plugin_system.core.stream_tool_history import ToolCallRecord, get_strea
logger = get_logger("tool_use")
@dataclass
@dataclass(slots=True)
class ToolExecutionConfig:
"""工具执行配置"""
max_concurrent_tools: int = 5 # 最大并发工具数量
@@ -25,7 +25,7 @@ class ToolExecutionConfig:
enable_dependency_check: bool = True # 是否启用依赖检查
@dataclass
@dataclass(slots=True)
class ToolExecutionResult:
"""工具执行结果"""
tool_call: ToolCall