myagent-ai 1.15.87 → 1.15.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/main_agent.py +3 -3
- package/memory/manager.py +1 -1
- package/package.json +1 -1
package/agents/main_agent.py
CHANGED
|
@@ -43,7 +43,7 @@ class MainAgent(BaseAgent):
|
|
|
43
43
|
|
|
44
44
|
严格以XML格式化输出以下内容,否则解析器无法解析:
|
|
45
45
|
<output>
|
|
46
|
-
<mainsubject>当前对话的6
|
|
46
|
+
<mainsubject>当前对话的6字以内标题(每轮都需输出,系统会每3轮自动更新会话名称)</mainsubject>
|
|
47
47
|
<usersays_correct>通过修正识别错误、调整标点,结合上下文,将用户语音转写文本"usersays"修正为更准确的文本,但尽量少改动。如"usersays"为空,则此处为空。</usersays_correct>
|
|
48
48
|
<response><reply>展示给用户的文本内容:直接回应用户问题;告诉用户,为完成任务,准备如何开展工作;根据工具调用结果,展示任务进展。注意:这是给用户展示信息的最重要标签。</reply><toolstocal>
|
|
49
49
|
<tool><beforecalltext>展示给用户的工具调用信息,方便用户了解调用目的。格式:先使用"接下来、下一步、接着、现在、然后"等连接词,然后介绍调用什么工具,达到什么目的。</beforecalltext><toolname>工具名,用于后台解析器解析调用工具</toolname><parms>调用工具的JSON格式参数对象,如格式: {"query": "搜索关键词", "num": 5}</parms><timeout>预估调用超时时限(秒),工具调用超时会立即回调大语言模型,方便调整工具使用</timeout></tool>
|
|
@@ -1000,8 +1000,8 @@ class MainAgent(BaseAgent):
|
|
|
1000
1000
|
except Exception as e:
|
|
1001
1001
|
logger.warning(f"[{task_id}] 存入知识库失败: {e}")
|
|
1002
1002
|
|
|
1003
|
-
# Step 6.6: [v1.15.8] 处理 mainsubject —
|
|
1004
|
-
if parsed.mainsubject and _history_user_msg_count
|
|
1003
|
+
# Step 6.6: [v1.15.8] 处理 mainsubject — 自动命名会话标题(每3轮更新一次)
|
|
1004
|
+
if parsed.mainsubject and _history_user_msg_count >= 1 and _history_user_msg_count % 3 == 0:
|
|
1005
1005
|
try:
|
|
1006
1006
|
subject = parsed.mainsubject.strip()[:20] # 安全截断
|
|
1007
1007
|
if self.memory:
|
package/memory/manager.py
CHANGED
|
@@ -22,7 +22,7 @@ from datetime import datetime, timezone
|
|
|
22
22
|
from typing import Any, Dict, List, Optional, Tuple
|
|
23
23
|
|
|
24
24
|
from core.logger import get_logger
|
|
25
|
-
from core.utils import generate_id, timestamp, truncate_str
|
|
25
|
+
from core.utils import generate_id, timestamp, truncate_str, get_config_tz
|
|
26
26
|
|
|
27
27
|
logger = get_logger("myagent.memory")
|
|
28
28
|
|