Package com.google.genkit.ai.agent
Class SessionSnapshot<S>
java.lang.Object
com.google.genkit.ai.agent.SessionSnapshot<S>
- Type Parameters:
S- the type of custom state
SessionSnapshot represents a point-in-time snapshot of an agent session.
Timestamps (createdAt, updatedAt, heartbeatAt) are stored as RFC-3339
strings for exact wire fidelity.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for SessionSnapshot. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> SessionSnapshot.Builder<S> builder()Creates a builder for SessionSnapshot.Returns the creation timestamp (RFC-3339).getError()Returns the runtime error, if any.Returns the finish reason.Returns the last-heartbeat timestamp (RFC-3339).Returns the parent snapshot ID.Returns the session ID.Returns the snapshot ID.getState()Returns the session state at this snapshot.Returns the snapshot status.Returns the last-update timestamp (RFC-3339).voidsetCreatedAt(String createdAt) Sets the creation timestamp.voidsetError(RuntimeError error) Sets the runtime error.voidsetFinishReason(AgentFinishReason finishReason) Sets the finish reason.voidsetHeartbeatAt(String heartbeatAt) Sets the last-heartbeat timestamp.voidsetParentId(String parentId) Sets the parent snapshot ID.voidsetSessionId(String sessionId) Sets the session ID.voidsetSnapshotId(String snapshotId) Sets the snapshot ID.voidsetState(SessionState<S> state) Sets the session state.voidsetStatus(SnapshotStatus status) Sets the snapshot status.voidsetUpdatedAt(String updatedAt) Sets the last-update timestamp.
-
Constructor Details
-
SessionSnapshot
public SessionSnapshot()Default constructor.
-
-
Method Details
-
builder
Creates a builder for SessionSnapshot.- Type Parameters:
S- the type of custom state- Returns:
- a new builder
-
getSnapshotId
Returns the snapshot ID.- Returns:
- the snapshot ID
-
setSnapshotId
Sets the snapshot ID.- Parameters:
snapshotId- the snapshot ID
-
getSessionId
Returns the session ID.- Returns:
- the session ID
-
setSessionId
Sets the session ID.- Parameters:
sessionId- the session ID
-
getParentId
Returns the parent snapshot ID.- Returns:
- the parent ID
-
setParentId
Sets the parent snapshot ID.- Parameters:
parentId- the parent ID
-
getCreatedAt
Returns the creation timestamp (RFC-3339).- Returns:
- the created-at timestamp
-
setCreatedAt
Sets the creation timestamp.- Parameters:
createdAt- the created-at timestamp (RFC-3339)
-
getUpdatedAt
Returns the last-update timestamp (RFC-3339).- Returns:
- the updated-at timestamp
-
setUpdatedAt
Sets the last-update timestamp.- Parameters:
updatedAt- the updated-at timestamp (RFC-3339)
-
getHeartbeatAt
Returns the last-heartbeat timestamp (RFC-3339).- Returns:
- the heartbeat-at timestamp
-
setHeartbeatAt
Sets the last-heartbeat timestamp.- Parameters:
heartbeatAt- the heartbeat-at timestamp (RFC-3339)
-
getStatus
Returns the snapshot status.- Returns:
- the status
-
setStatus
Sets the snapshot status.- Parameters:
status- the status
-
getFinishReason
Returns the finish reason.- Returns:
- the finish reason
-
setFinishReason
Sets the finish reason.- Parameters:
finishReason- the finish reason
-
getError
Returns the runtime error, if any.- Returns:
- the error, or null if no error
-
setError
Sets the runtime error.- Parameters:
error- the error
-
getState
Returns the session state at this snapshot.- Returns:
- the state
-
setState
Sets the session state.- Parameters:
state- the state
-