getSnapshot method

Future<AgentSnapshot<State>?> getSnapshot({
  1. String? snapshotId,
  2. String? sessionId,
  3. Map<String, dynamic>? context,
  4. bool metadataOnly = false,
})

Reads a snapshot without starting a chat. Requires a server store.

Returns a typed AgentSnapshot wrapper (with the same stateSchema applied to snapshot.state), or null when no snapshot is found.

Pass metadataOnly to read the shaped metadata without the state payload.

Implementation

Future<AgentSnapshot<State>?> getSnapshot({
  String? snapshotId,
  String? sessionId,
  Map<String, dynamic>? context,
  bool metadataOnly = false,
}) => _api.getSnapshot(
  snapshotId: snapshotId,
  sessionId: sessionId,
  context: context,
  metadataOnly: metadataOnly,
);