ObjectStoreTranscriptStore
public class ObjectStoreTranscriptStore implements TranscriptStore
io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:41–196对象存储 Transcript 存储,负责持久化与读取数据。位于 io.agentscope.harness.agent.transcript 包,实现 TranscriptStore。核心成员包括 withRuntimeContext、withFilesystem、appendSegment、listSegments、readSegment、compact。
TranscriptStore that writes immutable segment objects through AbstractFilesystem
(S3/OSS/NAS/sandbox backends that implement upload). Each flush uploads a new key — never
rewrites an existing object.
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public TranscriptStore withRuntimeContext(RuntimeContext rc) | 执行使用运行时上下文相关操作。 Performs the with runtime context operation. |
public ObjectStoreTranscriptStore withFilesystem(AbstractFilesystem filesystem) | 执行使用文件系统相关操作。 Returns a store that writes through `filesystem` while preserving this store's runtime
context and root prefix. |
public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl) | 追加 `appendSegment`。 Performs the append segment operation. |
public List<SegmentInfo> listSegments(TranscriptRef ref) | 列出 `listSegments`。 Lists the segments. |
public InputStream readSegment(String segmentKey) | 设置该参数。 Performs the read segment operation. |
public void compact(TranscriptRef ref) | 设置该参数。 Performs the compact operation. |
public void delete(TranscriptRef ref) | 删除数据。 Performs the delete operation. |
构造器详情Constructor Detail
ObjectStoreTranscriptStore
public ObjectStoreTranscriptStore(AbstractFilesystem filesystem)
初始化 ObjectStoreTranscriptStore 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:51–53ObjectStoreTranscriptStore
public ObjectStoreTranscriptStore(AbstractFilesystem filesystem, RuntimeContext rc, String rootPrefix)
初始化 ObjectStoreTranscriptStore 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
rc | RuntimeContext | rc(类型 `RuntimeContext`)。The rc. |
rootPrefix | String | 根 Prefix(类型 `String`)。The root prefix. |
io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:55–63方法详情Method Detail
withRuntimeContext
public TranscriptStore withRuntimeContext(RuntimeContext rc)
执行使用运行时上下文相关操作。
Performs the with runtime context operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rc | RuntimeContext | rc(类型 `RuntimeContext`)。The rc. |
TranscriptStoreio/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:65–71withFilesystem
public ObjectStoreTranscriptStore withFilesystem(AbstractFilesystem filesystem)
执行使用文件系统相关操作。
Returns a store that writes through filesystem while preserving this store's runtime context and root prefix.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
ObjectStoreTranscriptStoreio/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:77–79appendSegment
public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl)
追加 appendSegment。
Performs the append segment operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
seqStart | long | seq 启动(类型 `long`)。The seq start. |
seqEnd | long | seq 结束(类型 `long`)。The seq end. |
writerId | String | writer 标识(类型 `String`)。The writer id. |
jsonl | byte[] | jsonl(类型 `byte[]`)。The jsonl. |
Stringio/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:81–88listSegments
public List<SegmentInfo> listSegments(TranscriptRef ref)
列出 listSegments。
Lists the segments.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
List<SegmentInfo>io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:90–130readSegment
public InputStream readSegment(String segmentKey)
设置该参数。
Performs the read segment operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
segmentKey | String | segment 键(类型 `String`)。The segment key. |
InputStreamio/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:132–139compact
public void compact(TranscriptRef ref)
设置该参数。
Performs the compact operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:141–177delete
public void delete(TranscriptRef ref)
删除数据。
Performs the delete operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:179–188