Package-level declarations
Types
A saved point in a graph run.
The stored checkpoint of threadId could not be read, for example because the file is damaged or was written in a newer format. Checkpointer implementations throw this from Checkpointer.load.
Persists the checkpoints of each thread so a run can pause and resume later, even in a different process.
CompiledGraph.resume was called for threadId, but the checkpointer has no checkpoint for it.
An executable graph produced by StateGraph.compile. It is immutable and can be shared and run concurrently; each run is isolated by GraphConfig.threadId.
A routing function for a conditional edge: it inspects the current state and returns the name of the node to run next, or END to finish.
The condition of the conditional edge from from threw an exception. The original exception is available as cause. Cancellation is handled as for NodeExecutionException.
CompiledGraph.resume was called for threadId, but its last run already completed. Start a new run with CompiledGraph.invoke.
Per-run settings for a CompiledGraph.
A progress event emitted by CompiledGraph.stream and CompiledGraph.streamResume.
The outcome of CompiledGraph.invoke or CompiledGraph.resume.
The structure of a compiled graph: its nodes and the edges between them. Read it from CompiledGraph.topology to draw the graph or to check it in a test.
The graph ran more steps than GraphConfig.maxIterations allows, which usually means a cycle never routes to END.
A Checkpointer that keeps checkpoints in memory. Intended for tests and short-lived processes. Safe to share between coroutines and threads.
A reducer built with mergeRules could not merge the states of a step: a node changed a property that has no rule, or two nodes changed a property in ways its rule cannot combine. It is the cause of the ReducerException the run fails with.
The rules of a mergeRules block.
The work a node performs: a suspending function that takes the current state and returns the updated state.
A node's action threw an exception. The original exception is available as cause.
A reference to a node added with StateGraph.node. Use it with StateGraph.then and StateGraph.conditionalEdge to connect nodes without repeating their names, and read name where a node name is needed (for example in GraphConfig.interruptBefore).
A try of a node took longer than the timeout the node was added with, and was cancelled. It is the cause of the NodeExecutionException the run fails with, and what the retryOn of a Retry gets.
The Reducer threw an exception while it merged the results of nodes, the nodes of the failed step that each returned a whole state. The original exception is available as cause. Cancellation is handled as for NodeExecutionException.
Says how often a node is tried again after it failed, and how long the engine waits between two tries. Give it to a node as retry:
Builder for a graph of nodes and edges over an immutable State.
Converts a graph state to and from a string so a Checkpointer can persist it.
Where a run stands inside a subgraph that was added with StateGraph.subgraph. It is a Checkpoint without a state: the state of a subgraph is kept in the state of the graph around it.
Base class for every error raised by Telar itself, so callers can catch the whole family with a single catch (e: TelarException). Integration modules and custom Checkpointers may add their own subclasses.
CompiledGraph.fork was asked to start the thread threadId, which already has a checkpoint. A fork starts a thread of its own, so that it cannot overwrite a run. Choose another id, or delete the thread first.
Properties
Functions
Returns true when this code runs in a node of a run that is collected with CompiledGraph.stream or CompiledGraph.streamResume, so that what it passes to reportProgress reaches a collector. A node can use it to skip work that only produces progress.
Builds a Reducer from one rule for each property that nodes of the same step may change, in place of a reducer that merges whole states by hand:
Reports value from a running node to whoever collects the run: it arrives as a GraphEvent.NodeProgress in the flow of CompiledGraph.stream or CompiledGraph.streamResume, before the node's GraphEvent.NodeCompleted. Use it for what a node produces while it works, such as the text a model writes or how far a download is.
DSL entry point for building a StateGraph.
Returns this history of a thread after checkpoint is saved, for a Checkpointer that keeps a history: the checkpoints with an earlier step, then checkpoint, and of those the last maxHistory.