Class AgentExecutor.Builder
java.lang.Object
org.bsc.langgraph4j.spring.ai.agentexecutor.AgentExecutorBuilder<AgentExecutor.Builder,AgentExecutor.State>
org.bsc.langgraph4j.spring.ai.agentexecutor.AgentExecutor.Builder
- Enclosing interface:
- AgentExecutor
public static class AgentExecutor.Builder
extends AgentExecutorBuilder<AgentExecutor.Builder,AgentExecutor.State>
Class responsible for building a state graph.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns a StateGraph with the specified configuration.Methods inherited from class org.bsc.langgraph4j.spring.ai.agentexecutor.AgentExecutorBuilder
chatModel, chatModel, defaultSystem, result, stateSerializer, streamingChatModel, tool, tools, tools, toolsFromObject
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
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.- Returns:
- A configured StateGraph object.
- Throws:
GraphStateException
- If there is an issue with building the graph state.
-