ContextOffloadTool
public class ContextOffloadTool
源码Source
io/agentscope/core/memory/autocontext/ContextOffloadTool.java:32–133上下文卸载工具,封装可被智能体调用的能力。位于 io.agentscope.core.memory.autocontext 包。核心成员包括 reload、ContextOffloadTool。
Tool for reloading offloaded context messages.
This tool allows agents to retrieve previously offloaded context messages by their UUID. When context compression occurs, tool invocation messages are offloaded to storage with a UUID, and this tool can be used to restore them when needed.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public ContextOffloadTool(ContextOffLoader contextOffLoader) | 初始化 `ContextOffloadTool` 实例。 Creates a new ContextOffloadTool with the specified ContextOffLoader. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<Msg> reload(String uuid) | 设置重新加载。 Reload offloaded context messages by UUID. |
构造器详情Constructor Detail
ContextOffloadTool
public ContextOffloadTool(ContextOffLoader contextOffLoader)
初始化 ContextOffloadTool 实例。
Creates a new ContextOffloadTool with the specified ContextOffLoader.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
contextOffLoader | ContextOffLoader | 上下文 Off 加载器(类型 `ContextOffLoader`)。the context offloader to use for reloading messages |
源码Source
io/agentscope/core/memory/autocontext/ContextOffloadTool.java:41–43方法详情Method Detail
reload
public List<Msg> reload(String uuid)
设置重新加载。
Reload offloaded context messages by UUID.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
uuid | String | UUID(类型 `String`)。the UUID of the offloaded context to reload |
List<Msg>返回列出。a list of messages that were previously offloaded, or a list containing an error message if the UUID is not found or invalid
源码Source
io/agentscope/core/memory/autocontext/ContextOffloadTool.java:63–132