mirror of https://github.com/Mai-with-u/MaiBot.git
可选是否向提示词插入工具历史
parent
3e410f2643
commit
887d5bfd8b
|
|
@ -25,6 +25,11 @@ def get_tool_history_prompt(message_id: Optional[str] = None) -> str:
|
|||
Returns:
|
||||
格式化的工具历史提示词
|
||||
"""
|
||||
from src.config.config import global_config
|
||||
|
||||
if not global_config.tool.history.enable_prompt_history:
|
||||
return ""
|
||||
|
||||
return tool_history_manager.get_recent_history_prompt(
|
||||
chat_id=message_id
|
||||
)
|
||||
|
|
|
|||
|
|
@ -289,6 +289,9 @@ class ToolHistoryConfig(ConfigBase):
|
|||
|
||||
enable_history: bool = True
|
||||
"""是否启用工具历史记录"""
|
||||
|
||||
enable_prompt_history: bool = True
|
||||
"""是否在提示词中加入工具历史记录"""
|
||||
|
||||
max_history: int = 100
|
||||
"""历史记录最大保存数量"""
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ enable_tool = false # 是否在普通聊天中启用工具
|
|||
|
||||
[tool.history]
|
||||
enable_history = true # 是否启用工具调用历史记录
|
||||
enable_prompt_history = true # 是否在提示词中加入工具历史记录
|
||||
max_history = 5 # 每个会话最多保留的历史记录数
|
||||
|
||||
[mood]
|
||||
|
|
|
|||
Loading…
Reference in New Issue