ManagedMemoryTools
public final class ManagedMemoryTools
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:26–95托管记忆工具,封装可被智能体调用的能力。位于 io.agentscope.builder.web.managed 包。核心成员包括 list、read、write、edit、ManagedMemoryTools。
Direct CP memory operations also usable when filesystem tools execute on an external Worker.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ManagedMemoryTools(List<MemoryStoreFilesystem> stores) | 初始化 `ManagedMemoryTools` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String list(String id) | 设置列表。 Performs the list operation. |
public String read(String id, String path) | 执行读取相关操作。 Performs the read operation. |
public String write(String id, String path, String content) | 执行写入相关操作。 Performs the write operation. |
public String edit(String id, String path, String oldText, String newText) | 执行 `edit` 方法。 Performs the edit operation. |
构造器详情Constructor Detail
ManagedMemoryTools
public ManagedMemoryTools(List<MemoryStoreFilesystem> stores)
初始化 ManagedMemoryTools 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stores | List<MemoryStoreFilesystem> | stores(类型 `List`)。The stores. |
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:30–33方法详情Method Detail
list
public String list(String id)
设置列表。
Performs the list operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:49–59read
public String read(String id, String path)
执行读取相关操作。
Performs the read operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
path | String | 路径(类型 `String`)。The path. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:61–69write
public String write(String id, String path, String content)
执行写入相关操作。
Performs the write operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
path | String | 路径(类型 `String`)。The path. |
content | String | 内容(类型 `String`)。The content. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:71–81edit
public String edit(String id, String path, String oldText, String newText)
执行 edit 方法。
Performs the edit operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
path | String | 路径(类型 `String`)。The path. |
oldText | String | 旧的文本(类型 `String`)。The old text. |
newText | String | 新建文本(类型 `String`)。The new text. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/builder/web/managed/ManagedMemoryTools.java:83–94