mirror of
https://gitcode.com/JianFeeeee/TrulyMEM-TrueHumanMEM.git
synced 2026-09-21 01:18:15 +00:00
refactor: 工具调用限制全部移入 config.json,代码零硬编码
- 删除 server.py BackendServer.__init__ 中 _tool_limits 的硬编码字典 - _load_config 从 ~/.trulymem/config.json 读取全部限制值 - 首次启动无配置文件时自动生成带默认值的 config.json - _create_tool_limiter 直接索引 _tool_limits 字典,无硬编码兜底 - 如需修改限制值,编辑 ~/.trulymem/config.json 即可生效(下次重启)
This commit is contained in:
@ -7,7 +7,10 @@ from dataclasses import dataclass
|
||||
|
||||
@dataclass
|
||||
class ToolLimits:
|
||||
"""工具调用限制配置"""
|
||||
"""工具调用限制配置
|
||||
实际值由 server.py 从 config.json 加载后传入,此处默认值仅作安全兜底。
|
||||
如需修改限制,请编辑 ~/.trulymem/config.json。
|
||||
"""
|
||||
persona_update_max: int = 1
|
||||
task_update_max: int = 20 # 工作记忆链修改(create/set_state/delete/link_info)
|
||||
task_query_max: int = 30 # 工作记忆链查询(memory_recall 查任务相关)
|
||||
|
||||
Reference in New Issue
Block a user