FilesystemTranscriptStore
public class FilesystemTranscriptStore implements TranscriptStore
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:42–181文件系统 Transcript 存储,负责持久化与读取数据。位于 io.agentscope.harness.agent.transcript 包,实现 TranscriptStore。核心成员包括 appendSegment、listSegments、readSegment、compact、delete、FilesystemTranscriptStore。
TranscriptStore backed by a local / NAS filesystem directory.
Each segment is an immutable file under
{root}/{tenant}/{agentId}/{sessionId}/events/. POSIX append is used only when
compacting into a single object; normal writes create new files.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public FilesystemTranscriptStore(Path root) | 初始化 `FilesystemTranscriptStore` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
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
FilesystemTranscriptStore
public FilesystemTranscriptStore(Path root)
初始化 FilesystemTranscriptStore 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
root | Path | 根(类型 `Path`)。The root. |
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:50–52方法详情Method Detail
appendSegment
public String appendSegment(TranscriptRef ref, long seqStart, long seqEnd, String writerId, byte[] jsonl)
追加 appendSegment。
Performs the append segment operation.
参数Parameters
| 名称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. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:54–68listSegments
public List<SegmentInfo> listSegments(TranscriptRef ref)
列出 listSegments。
Lists the segments.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
List<SegmentInfo>返回列出。Returns list.
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:70–103readSegment
public InputStream readSegment(String segmentKey)
设置该参数。
Performs the read segment operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
segmentKey | String | segment 键(类型 `String`)。The segment key. |
InputStream返回InputStream。Returns input stream.
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:105–113compact
public void compact(TranscriptRef ref)
设置该参数。
Performs the compact operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:115–146delete
public void delete(TranscriptRef ref)
删除数据。
Performs the delete operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ref | TranscriptRef | 引用(类型 `TranscriptRef`)。The ref. |
源码Source
io/agentscope/harness/agent/transcript/FilesystemTranscriptStore.java:148–162