Class AgentExecutor.Builder
java.lang.Object
org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder<ReactAgent.Builder<State>,State>
org.bsc.langgraph4j.spring.ai.agent.ReactAgent.Builder<AgentExecutor.State>
org.bsc.langgraph4j.spring.ai.agentexecutor.AgentExecutor.Builder
- Enclosing interface:
- AgentExecutor
Class responsible for building a state graph.
-
Field Summary
Fields inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgent.Builder
agentBuilderFields inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder
chatModel, conversationContextPolicy, emitStreamingOutputEnd, schema, stateSerializer, streaming, systemMessage, tools -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(Function<ReactAgentBuilder<?, ?>, ReactAgent.ChatService> chatServiceFactory) Builds and returns a StateGraph with the specified configuration.Methods inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgent.Builder
addCallModelHook, addExecuteToolsHookMethods inherited from class org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder
build, chatModel, chatModel, chatModel, conversationContextPolicy, defaultSystem, emitStreamingEnd, result, schema, skills, skills, stateSerializer, streaming, systemMessage, tool, tools, tools, tools, toolsFromObject
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
public StateGraph<AgentExecutor.State> build(Function<ReactAgentBuilder<?, ?>, throws GraphStateExceptionReactAgent.ChatService> chatServiceFactory) Description copied from class:ReactAgent.BuilderBuilds 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.- Overrides:
buildin classReactAgent.Builder<AgentExecutor.State>- Returns:
- A configured StateGraph object.
- Throws:
GraphStateException- If there is an issue with building the graph state.
-