AS AgentScopeAPI 手册 / API Reference

ObjectStoreTranscriptStore

public class ObjectStoreTranscriptStore implements TranscriptStore
源码Source 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

构造器Constructor说明Description
public ObjectStoreTranscriptStore(AbstractFilesystem filesystem)
初始化 `ObjectStoreTranscriptStore` 实例。
Creates a new instance.
public ObjectStoreTranscriptStore(AbstractFilesystem filesystem, RuntimeContext rc, String rootPrefix)
初始化 `ObjectStoreTranscriptStore` 实例。
Creates a new instance.

方法摘要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.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:51–53

ObjectStoreTranscriptStore

public ObjectStoreTranscriptStore(AbstractFilesystem filesystem, RuntimeContext rc, String rootPrefix)

初始化 ObjectStoreTranscriptStore 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
rcRuntimeContextrc(类型 `RuntimeContext`)。The rc.
rootPrefixString根 Prefix(类型 `String`)。The root prefix.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:55–63

方法详情Method Detail

withRuntimeContext

public TranscriptStore withRuntimeContext(RuntimeContext rc)

执行使用运行时上下文相关操作。

Performs the with runtime context operation.

参数Parameters
名称Name类型Type说明Description
rcRuntimeContextrc(类型 `RuntimeContext`)。The rc.
返回Returns TranscriptStore
返回TranscriptStore。Returns transcript store.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:65–71

withFilesystem

public ObjectStoreTranscriptStore withFilesystem(AbstractFilesystem filesystem)

执行使用文件系统相关操作。

Returns a store that writes through filesystem while preserving this store's runtime context and root prefix.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
返回Returns ObjectStoreTranscriptStore
返回ObjectStoreTranscriptStore。Returns object store transcript store.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:77–79

appendSegment

public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl)

追加 appendSegment。

Performs the append segment operation.

参数Parameters
名称Name类型Type说明Description
refTranscriptRef引用(类型 `TranscriptRef`)。The ref.
seqStartlongseq 启动(类型 `long`)。The seq start.
seqEndlongseq 结束(类型 `long`)。The seq end.
writerIdStringwriter 标识(类型 `String`)。The writer id.
jsonlbyte[]jsonl(类型 `byte[]`)。The jsonl.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:81–88

listSegments

public List<SegmentInfo> listSegments(TranscriptRef ref)

列出 listSegments。

Lists the segments.

参数Parameters
名称Name类型Type说明Description
refTranscriptRef引用(类型 `TranscriptRef`)。The ref.
返回Returns List<SegmentInfo>
返回列出。Returns list.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:90–130

readSegment

public InputStream readSegment(String segmentKey)

设置该参数。

Performs the read segment operation.

参数Parameters
名称Name类型Type说明Description
segmentKeyStringsegment 键(类型 `String`)。The segment key.
返回Returns InputStream
返回InputStream。Returns input stream.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:132–139

compact

public void compact(TranscriptRef ref)

设置该参数。

Performs the compact operation.

参数Parameters
名称Name类型Type说明Description
refTranscriptRef引用(类型 `TranscriptRef`)。The ref.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:141–177

delete

public void delete(TranscriptRef ref)

删除数据。

Performs the delete operation.

参数Parameters
名称Name类型Type说明Description
refTranscriptRef引用(类型 `TranscriptRef`)。The ref.
源码Source io/agentscope/harness/agent/transcript/ObjectStoreTranscriptStore.java:179–188
基于官方固定版本源码静态生成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.