Package org.bsc.langgraph4j
Class RunnableConfig.Builder
java.lang.Object
org.bsc.langgraph4j.HasMetadata.Builder<RunnableConfig.Builder>
org.bsc.langgraph4j.RunnableConfig.Builder
- Enclosing class:
RunnableConfig
A builder pattern class for constructing
RunnableConfig objects.
This class provides a fluent interface to set various properties of a
RunnableConfig object and then build the final configuration.-
Method Summary
Modifier and TypeMethodDescriptionaddParallelNodeExecutor(String nodeId, Executor executor) Adds a customExecutorfor a specific parallel node.build()Constructs and returns the configuredRunnableConfigobject.checkPointId(String checkPointId) Sets the checkpoint ID for the configuration.Disables state cloning during graph execution.Sets the next node in the configuration and returns this builder for method chaining.recursionLimit(int recursionLimit) Sets the maximum number of iterations allowed for this invocation.streamMode(CompiledGraph.StreamMode streamMode) Sets the stream mode of the configuration.Sets the ID of the thread.Methods inherited from class org.bsc.langgraph4j.HasMetadata.Builder
addMetadata, metadata, putMetadata, putMetadata, putMetadataIfAbsent, removeMetadata, this$
-
Method Details
-
graphId
-
threadId
Sets the ID of the thread.- Parameters:
threadId- the ID of the thread to set- Returns:
- a reference to this
Builderobject so that method calls can be chained together
-
checkPointId
Sets the checkpoint ID for the configuration.- Parameters:
checkPointId- - the ID of the checkpoint to be set- Returns:
- this - a reference to the current `Builder` instance
-
nextNode
Sets the next node in the configuration and returns this builder for method chaining.- Parameters:
nextNode- The next node to be set.- Returns:
- This builder instance, allowing for method chaining.
-
streamMode
Sets the stream mode of the configuration.- Parameters:
streamMode- TheCompiledGraph.StreamModeto set.- Returns:
- A reference to this builder for method chaining.
-
recursionLimit
Sets the maximum number of iterations allowed for this invocation.- Parameters:
recursionLimit- the maximum number of iterations, greater than zero- Returns:
- this builder
-
addParallelNodeExecutor
Adds a customExecutorfor a specific parallel node.This allows you to control the execution of branches within a parallel node. When a parallel node is executed, it will look for an executor in the
RunnableConfigmetadata. If found, it will be used to run the parallel branches concurrently.- Parameters:
nodeId- the ID of the parallel node.executor- theExecutorto use for the parallel node.- Returns:
- this
Builderinstance for method chaining.
-
disableCloneState
Disables state cloning during graph execution.When state cloning is disabled, state exposed outside the graph boundary is not guaranteed to be immutable and may reflect subsequent mutations.
- Returns:
- this
Builderinstance for method chaining - Since:
- 1.9
-
build
Constructs and returns the configuredRunnableConfigobject.- Returns:
- the configured
RunnableConfigobject
-