AS AgentScopeAPI 手册 / API Reference

CompactionEntry

public static final class CompactionEntry extends SessionEntry
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:255–279

压缩条目,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.harness.agent.memory.session 包,继承自 SessionEntry。核心成员包括 getFirstKeptEntryId、getSummaryEntryId、CompactionEntry。

Non-destructive compaction marker. Records which entry is the first kept entry — all entries before firstKeptEntryId are considered compacted (not visible to the LLM) but remain in the file for full history replay.

构造器摘要Constructor Summary

构造器Constructor说明Description
public CompactionEntry(String id, String parentId, Instant timestamp, String firstKeptEntryId, String summaryEntryId)
初始化 `CompactionEntry` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getFirstKeptEntryId()
获取 `getFirstKeptEntryId`。
Returns the first kept entry id.
public String getSummaryEntryId()
获取摘要条目标识。
Returns the summary entry id.

构造器详情Constructor Detail

CompactionEntry

public CompactionEntry(String id, String parentId, Instant timestamp, String firstKeptEntryId, String summaryEntryId)

初始化 CompactionEntry 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
parentIdString父级标识(类型 `String`)。The parent id.
timestampInstant时间戳(类型 `Instant`)。The timestamp.
firstKeptEntryIdString第一个 Kept 条目标识(类型 `String`)。The first kept entry id.
summaryEntryIdString摘要条目标识(类型 `String`)。The summary entry id.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:260–270

方法详情Method Detail

getFirstKeptEntryId

public String getFirstKeptEntryId()

获取 getFirstKeptEntryId。

Returns the first kept entry id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:272–274

getSummaryEntryId

public String getSummaryEntryId()

获取摘要条目标识。

Returns the summary entry id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/memory/session/SessionEntry.java:276–278

继承成员Inherited Members

继承自Methods inherited from SessionEntry
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.