Class ObjectStoreTranscriptStore
java.lang.Object
io.agentscope.harness.agent.transcript.ObjectStoreTranscriptStore
- All Implemented Interfaces:
TranscriptStore
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.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.agentscope.harness.agent.transcript.TranscriptStore
TranscriptStore.SegmentInfo -
Constructor Summary
ConstructorsConstructorDescriptionObjectStoreTranscriptStore(AbstractFilesystem filesystem) ObjectStoreTranscriptStore(AbstractFilesystem filesystem, io.agentscope.core.agent.RuntimeContext rc, String rootPrefix) -
Method Summary
Modifier and TypeMethodDescriptionappendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl) Appends one immutable JSONL segment and returns its storage key.voidcompact(TranscriptRef ref) Optional compaction of small segments into a single object.voiddelete(TranscriptRef ref) Deletes all segments for the transcript.Lists segments ordered byseqStartascending.readSegment(String segmentKey) Opens a segment for reading; caller must close the stream.withFilesystem(AbstractFilesystem filesystem) Returns a store that writes throughfilesystemwhile preserving this store's runtime context and root prefix.withRuntimeContext(io.agentscope.core.agent.RuntimeContext rc) Returns a store view bound to the given per-callRuntimeContextso that namespace-scoped backends (e.g., per-user local filesystems) route transcript segments into the caller's namespace instead of the un-namespaced root.
-
Constructor Details
-
ObjectStoreTranscriptStore
-
ObjectStoreTranscriptStore
public ObjectStoreTranscriptStore(AbstractFilesystem filesystem, io.agentscope.core.agent.RuntimeContext rc, String rootPrefix)
-
-
Method Details
-
withRuntimeContext
Description copied from interface:TranscriptStoreReturns a store view bound to the given per-callRuntimeContextso that namespace-scoped backends (e.g., per-user local filesystems) route transcript segments into the caller's namespace instead of the un-namespaced root.Stores whose location is fixed at construction time may ignore the context and return
this.- Specified by:
withRuntimeContextin interfaceTranscriptStore
-
withFilesystem
Returns a store that writes throughfilesystemwhile preserving this store's runtime context and root prefix. Used when session mirrors pin a sandbox reference for async upload. -
appendSegment
public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl) Description copied from interface:TranscriptStoreAppends one immutable JSONL segment and returns its storage key.- Specified by:
appendSegmentin interfaceTranscriptStore- Parameters:
ref- transcript identityseqStart- inclusive start sequence (caller-assigned, contiguous preferred)seqEnd- inclusive end sequencewriterId- unique writer / replica id (prevents key collisions)jsonl- UTF-8 JSONL payload (oneSessionEntryper line)- Returns:
- storage key of the written segment
-
listSegments
Description copied from interface:TranscriptStoreLists segments ordered byseqStartascending.- Specified by:
listSegmentsin interfaceTranscriptStore
-
readSegment
Description copied from interface:TranscriptStoreOpens a segment for reading; caller must close the stream.- Specified by:
readSegmentin interfaceTranscriptStore
-
compact
Description copied from interface:TranscriptStoreOptional compaction of small segments into a single object.- Specified by:
compactin interfaceTranscriptStore
-
delete
Description copied from interface:TranscriptStoreDeletes all segments for the transcript.- Specified by:
deletein interfaceTranscriptStore
-