Package com.google.genkit.ai.agent
Class FileSessionStore.Builder<S>
java.lang.Object
com.google.genkit.ai.agent.FileSessionStore.Builder<S>
- Type Parameters:
S- the type of custom session state
- Enclosing class:
FileSessionStore<S>
Builder for
FileSessionStore.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newFileSessionStore.maxPersistedChainLength(int maxPersistedChainLength) Sets the maximum number of snapshot files to retain in the parent chain.Sets the prefix sub-directory (default"global").rejectBranchingSessions(boolean rejectBranchingSessions) Iftrue,LeafSelection.selectLeaf(java.util.List<com.google.genkit.ai.agent.SessionSnapshot<S>>, boolean)throws when more than one leaf exists for a session.snapshotWatchPollIntervalMs(long ms) Sets the polling interval for snapshot-change subscriptions (default 2000 ms).
-
Method Details
-
prefix
Sets the prefix sub-directory (default"global").- Parameters:
prefix- the prefix- Returns:
- this builder
-
maxPersistedChainLength
Sets the maximum number of snapshot files to retain in the parent chain. When set to a positive value, older ancestors are deleted after each new save. Zero (default) means unlimited.- Parameters:
maxPersistedChainLength- the maximum chain length, or 0 for unlimited- Returns:
- this builder
-
rejectBranchingSessions
Iftrue,LeafSelection.selectLeaf(java.util.List<com.google.genkit.ai.agent.SessionSnapshot<S>>, boolean)throws when more than one leaf exists for a session.- Parameters:
rejectBranchingSessions- whether to reject branching- Returns:
- this builder
-
snapshotWatchPollIntervalMs
Sets the polling interval for snapshot-change subscriptions (default 2000 ms). Use a small value (e.g. 100 ms) in tests for faster callback detection.- Parameters:
ms- the poll interval in milliseconds- Returns:
- this builder
-
build
Builds a newFileSessionStore.- Returns:
- a new store
-