GraphConfig

data class GraphConfig<State>(val threadId: String = "default", val checkpointer: Checkpointer<State>? = null, val interruptBefore: Set<String> = emptySet(), val interruptAfter: Set<String> = emptySet(), val maxIterations: Int = DEFAULT_MAX_ITERATIONS, val observers: List<GraphObserver> = emptyList(), val store: Store? = null)

Per-run settings for a CompiledGraph.

Throws

if threadId is blank, maxIterations is not positive, or interrupts are configured without a checkpointer.

Constructors

Link copied to clipboard
constructor(threadId: String = "default", checkpointer: Checkpointer<State>? = null, interruptBefore: Set<String> = emptySet(), interruptAfter: Set<String> = emptySet(), maxIterations: Int = DEFAULT_MAX_ITERATIONS, observers: List<GraphObserver> = emptyList(), store: Store? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

where checkpoints are stored. When set, a checkpoint is saved when a run starts and after every step. Required for interruptBefore, interruptAfter, interrupt and CompiledGraph.resume.

Link copied to clipboard

node names to pause after, and paths to nodes of subgraphs. A pause after the last node of a subgraph happens before the graph around it goes on.

Link copied to clipboard

node names to pause before, for human-in-the-loop review. A node of a subgraph is named by its path: the name of the subgraph node, a / and the name of the node in the subgraph, such as "research/ask", or "research/sources/ask" for a subgraph inside it. A node that decides while it runs whether to pause calls interrupt instead.

Link copied to clipboard

the maximum number of steps a single CompiledGraph.invoke or CompiledGraph.resume call may execute before MaxIterationsExceededException is thrown.

Link copied to clipboard

are told how each run of this config goes, node by node, for example to send traces. See GraphObserver.

Link copied to clipboard
val store: Store?

what the run remembers across threads, which its nodes and tools reach with store. Give each user a part of it of their own with within. See Store.

Link copied to clipboard

identifies the conversation or workflow instance whose checkpoints are stored by checkpointer. Use one id per independent run.