CheckpointStore
このコンテンツはまだ日本語訳がありません。
快照存储接口(自建实现注入 createSession({ checkpoints: { store } }))。实现纪律:
put须配对治理后落盘,返回的 meta.messageCount 为治理后消息数;list恒不携 messages,按 checkpointId 升序(= 时间序)返回;不存在的会话返回[];get不存在返回 null;存储损坏恒结构化 throw(恒不静默回残缺快照);delete幂等(目标不存在不抛)。
delete()
Section titled “delete()”delete(sessionId, checkpointId): Promise<void>;删除快照(幂等)
sessionId
Section titled “sessionId”string
checkpointId
Section titled “checkpointId”string
Promise<void>
get(sessionId, checkpointId): Promise<ContextCheckpoint | null>;读取快照(不存在 → null;损坏结构化 throw)
sessionId
Section titled “sessionId”string
checkpointId
Section titled “checkpointId”string
Promise<ContextCheckpoint | null>
list()
Section titled “list()”list(sessionId): Promise<ContextCheckpointMeta[]>;列举某会话全部快照的头部(恒无内容;checkpointId 升序)
sessionId
Section titled “sessionId”string
Promise<ContextCheckpointMeta[]>
put(cp): Promise<ContextCheckpointMeta>;写入快照(durable);返回头部 meta
Promise<ContextCheckpointMeta>
このページは役に立ちましたか?
フィードバックありがとうございます。この記事の改善に活かします。