myagent-ai 1.23.12 → 1.23.13
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 +9 -9
- package/package.json +1 -1
package/agents/main_agent.py
CHANGED
|
@@ -63,13 +63,13 @@ class MainAgent(BaseAgent):
|
|
|
63
63
|
</output>
|
|
64
64
|
|
|
65
65
|
注意事项:
|
|
66
|
-
1. toolstocal标签: 尽量一次性列出所有需执行工具调用的,多个"tool"工具调用只要按顺序重复堆叠tool
|
|
66
|
+
1. toolstocal标签: 尽量一次性列出所有需执行工具调用的,多个"tool"工具调用只要按顺序重复堆叠tool标签即可,解析器会按顺序执行工具调用,最终全部执行完后,会连同所有结果,回调大语言模型。如果某个工具执行超时了,也会回调大模型,让大模型分析为什么超时,改用其他工具。要求每个工具调用尽快合并多个命令行。注意: docx/xlsx/ppt/pdf-create 命令执行后会自动发送文件给用户,不需要再拼接 send-file。仅在需要发送其他已存在的独立文件时才需要手动调用 send-file。多个独立查询或系统命令才需要用 && 拼接。
|
|
67
67
|
2. 上下文中的记忆系统说明
|
|
68
68
|
- <automemory>: 系统自动根据你通过 <remember> 保存的记忆和当前用户输入,搜索出的 top10 相关记忆。这些是你过去主动记住的内容(包含时间信息),可供参考。
|
|
69
69
|
- <recall_memory>: 你在上一轮通过 <recall> 指定的记忆搜索结果。系统根据你提供的关键字和时间点搜索了 top5 相关记忆。
|
|
70
70
|
- 两种记忆互补:automemory 是自动匹配的,recall_memory 是你主动指定搜索的。如果 automemory 不足,使用 <recall> 请求更多。
|
|
71
71
|
3. 工具使用指南 — 只有两个工具: command 和 web_control
|
|
72
|
-
4.
|
|
72
|
+
4. 文件自动发送与下载链接: docx-create、xlsx-create、ppt-create、pdf-create、write 等命令执行成功后会**自动**将文件发送给用户(无需手动调用 send-file)。系统会返回包含下载链接的文件卡片,LLM 不需要自行拼接文件链接。仅在需要发送其他独立文件(如已存在的文件)时,才使用 myagent-ai send-file <文件路径> [描述]。向用户展示下载链接时,务必使用 Markdown 超链接格式: [文件名](完整URL)。
|
|
73
73
|
|
|
74
74
|
**command**(执行命令行,所有操作都通过它完成):
|
|
75
75
|
<tool><toolname>command</toolname><parms>{"command": "要执行的命令"}</parms><timeout>超时秒数</timeout></tool>
|
|
@@ -96,14 +96,14 @@ class MainAgent(BaseAgent):
|
|
|
96
96
|
- 发送文件给用户: myagent-ai send-file 文件路径 描述
|
|
97
97
|
|
|
98
98
|
【文档生成】
|
|
99
|
-
- 创建Word: myagent-ai docx-create -c '{JSON内容}' -t 标题
|
|
99
|
+
- 创建Word: myagent-ai docx-create -c '{JSON内容}' -t 标题 (自动发送文件)
|
|
100
100
|
- 读取Word: myagent-ai docx-read 文件.docx
|
|
101
|
-
- 创建Excel: myagent-ai xlsx-create -s '{JSON工作表}' -t 标题
|
|
101
|
+
- 创建Excel: myagent-ai xlsx-create -s '{JSON工作表}' -t 标题 (自动发送文件)
|
|
102
102
|
- 读取Excel: myagent-ai xlsx-read 文件.xlsx [--sheet 名称]
|
|
103
103
|
- 编辑Excel: myagent-ai xlsx-edit 文件.xlsx append-row -d '{JSON}'
|
|
104
|
-
- 创建PPT: myagent-ai ppt-create -s '{JSON幻灯片}'
|
|
104
|
+
- 创建PPT: myagent-ai ppt-create -s '{JSON幻灯片}' (自动发送文件)
|
|
105
105
|
- 读取PPT: myagent-ai ppt-read 文件.pptx
|
|
106
|
-
- 创建PDF: myagent-ai pdf-create -c '{JSON内容}'
|
|
106
|
+
- 创建PDF: myagent-ai pdf-create -c '{JSON内容}' (自动发送文件)
|
|
107
107
|
- 读取PDF: myagent-ai pdf-read 文件.pdf [--start N] [--end N]
|
|
108
108
|
|
|
109
109
|
【系统】
|
|
@@ -145,14 +145,14 @@ class MainAgent(BaseAgent):
|
|
|
145
145
|
|
|
146
146
|
调用示例:
|
|
147
147
|
<tool><toolname>command</toolname><parms>{"command": "myagent-ai search 人工智能最新进展"}</parms><timeout>15</timeout></tool>
|
|
148
|
-
<tool><toolname>command</toolname><parms>{"command": "myagent-ai docx-create -c '{\"title\": \"报告\", \"sections\": [{\"heading\": \"摘要\", \"body\": \"内容\"}]}' -t 周报
|
|
149
|
-
<tool><toolname>command</toolname><parms>{"command": "myagent-ai ppt-create -s '{JSON幻灯片}'
|
|
148
|
+
<tool><toolname>command</toolname><parms>{"command": "myagent-ai docx-create -c '{\"title\": \"报告\", \"sections\": [{\"heading\": \"摘要\", \"body\": \"内容\"}]}' -t 周报"}</parms><timeout>30</timeout></tool>
|
|
149
|
+
<tool><toolname>command</toolname><parms>{"command": "myagent-ai ppt-create -s '{JSON幻灯片}'"}</parms><timeout>30</timeout></tool>
|
|
150
150
|
<tool><toolname>command</toolname><parms>{"command": "myagent-ai playaudio --url https://music.163.com/song?id=123 --title 歌曲名"}</parms><timeout>10</timeout></tool>
|
|
151
151
|
<tool><toolname>command</toolname><parms>{"command": "myagent-ai playvideo --url https://www.bilibili.com/video/BV123 --title 视频名"}</parms><timeout>10</timeout></tool>
|
|
152
152
|
|
|
153
153
|
多个命令可用 && 连接一次执行(强烈推荐,减少LLM回调次数):
|
|
154
|
-
<tool><toolname>command</toolname><parms>{"command": "myagent-ai docx-create -c '{JSON}' -t 标题 && myagent-ai send-file /path/to/文件.docx 描述"}</parms><timeout>30</timeout></tool>
|
|
155
154
|
<tool><toolname>command</toolname><parms>{"command": "myagent-ai search xxx && myagent-ai read-url https://..."}</parms><timeout>30</timeout></tool>
|
|
155
|
+
<tool><toolname>command</toolname><parms>{"command": "myagent-ai sysinfo && myagent-ai ps --filter python"}</parms><timeout>15</timeout></tool>
|
|
156
156
|
|
|
157
157
|
**web_control**(网页控制器,在聊天中打开可操作的浏览器面板):
|
|
158
158
|
<tool><toolname>web_control</toolname><parms>{"action": "open", "url": "https://example.com"}</parms><timeout>30</timeout></tool>
|