MemoryGetTool
public class MemoryGetTool
源码Source
io/agentscope/harness/agent/tool/MemoryGetTool.java:29–84记忆读取工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 memoryGet、MemoryGetTool。
Tool for reading specific lines from memory files, typically used after
MemorySearchTool to fetch surrounding context.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public MemoryGetTool(WorkspaceManager workspaceManager) | 初始化 `MemoryGetTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String memoryGet(RuntimeContext runtimeContext, String path, int startLine, int endLine) | 执行记忆读取相关操作。 Performs the memory get operation. |
构造器详情Constructor Detail
MemoryGetTool
public MemoryGetTool(WorkspaceManager workspaceManager)
初始化 MemoryGetTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspaceManager | WorkspaceManager | 工作区管理器(类型 `WorkspaceManager`)。The workspace manager. |
源码Source
io/agentscope/harness/agent/tool/MemoryGetTool.java:33–35方法详情Method Detail
memoryGet
public String memoryGet(RuntimeContext runtimeContext, String path, int startLine, int endLine)
执行记忆读取相关操作。
Performs the memory get operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
path | String | 路径(类型 `String`)。The path. |
startLine | int | 启动 Line(类型 `int`)。The start line. |
endLine | int | 结束 Line(类型 `int`)。The end line. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/tool/MemoryGetTool.java:37–83