【迁移】工具系统再完善:工具缓存、ttl支持、自动记录、长期保存、自动清理缓存、将记录与执行分离、api记录查询、时间聊天工具筛选查询...
This commit is contained in:
@@ -396,13 +396,29 @@ class ExpressionConfig(ValidatedConfigBase):
|
||||
return None
|
||||
|
||||
|
||||
class ToolHistoryConfig(ValidatedConfigBase):
|
||||
"""工具历史记录配置类"""
|
||||
|
||||
enable_history: bool = True
|
||||
"""是否启用工具历史记录"""
|
||||
|
||||
enable_prompt_history: bool = True
|
||||
"""是否在提示词中加入工具历史记录"""
|
||||
|
||||
max_history: int = 5
|
||||
"""注入到提示词中的最大工具历史记录数量"""
|
||||
|
||||
data_dir: str = "data/tool_history"
|
||||
"""历史记录保存目录"""
|
||||
|
||||
|
||||
class ToolConfig(ValidatedConfigBase):
|
||||
"""工具配置类"""
|
||||
|
||||
enable_tool: bool = Field(default=False, description="启用工具")
|
||||
|
||||
|
||||
history: ToolHistoryConfig = Field(default_factory=ToolHistoryConfig)
|
||||
"""工具历史记录配置"""
|
||||
|
||||
class VoiceConfig(ValidatedConfigBase):
|
||||
"""语音识别配置类"""
|
||||
|
||||
Reference in New Issue
Block a user