Class AgentExecutorEx.Builder
java.lang.Object
org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder<AgentExecutorEx.Builder,AgentExecutorEx.State>
org.bsc.langgraph4j.spring.ai.agentexecutor.AgentExecutorEx.Builder
- Enclosing interface:
- AgentExecutorEx
public static class AgentExecutorEx.Builder
extends ReactAgentBuilder<AgentExecutorEx.Builder,AgentExecutorEx.State>
Class responsible for building a state graph.
-
Field Summary
Fields inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder
chatModel, schema, stateSerializer, streaming, systemMessage, tools -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapprovalOn(String actionId, BiFunction<String, AgentExecutorEx.State, InterruptionMetadata<AgentExecutorEx.State>> interruptionMetadataProvider) build(Function<ReactAgentBuilder<?, ?>, ReactAgent.ChatService> chatServiceFactory) Builds and returns a StateGraph with the specified configuration.Methods inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder
build, chatModel, chatModel, defaultSystem, result, schema, stateSerializer, systemMessage, tool, tools, tools, tools, toolsFromObject
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
approvalOn
public AgentExecutorEx.Builder approvalOn(String actionId, BiFunction<String, AgentExecutorEx.State, InterruptionMetadata<AgentExecutorEx.State>> interruptionMetadataProvider) -
build
public StateGraph<AgentExecutorEx.State> build(Function<ReactAgentBuilder<?, ?>, throws GraphStateExceptionReactAgent.ChatService> chatServiceFactory) Builds and returns a StateGraph with the specified configuration. Initializes the stateSerializer if it's null. Then, constructs a new StateGraph object using the provided schema and serializer, adds an initial edge from the START node to "agent", and then proceeds to add nodes for "agent" and "action". It also sets up conditional edges from the "agent" node based on whether or not to continue.- Specified by:
buildin classReactAgentBuilder<AgentExecutorEx.Builder,AgentExecutorEx.State> - Returns:
- A configured StateGraph object.
- Throws:
GraphStateException- If there is an issue with building the graph state.
-