Class ReactAgentBuilder<B extends ReactAgentBuilder<B,State>,State extends MessagesState<org.springframework.ai.chat.messages.Message>>

java.lang.Object
org.bsc.langgraph4j.spring.ai.agent.ReactAgentBuilder<B,State>
Direct Known Subclasses:
AgentExecutorEx.Builder, ReactAgent.Builder

public abstract class ReactAgentBuilder<B extends ReactAgentBuilder<B,State>,State extends MessagesState<org.springframework.ai.chat.messages.Message>> extends Object
  • Field Details

    • stateSerializer

      protected StateSerializer<State extends MessagesState<org.springframework.ai.chat.messages.Message>> stateSerializer
    • chatModel

      protected org.springframework.ai.chat.model.ChatModel chatModel
    • systemMessage

      protected String systemMessage
    • streaming

      protected boolean streaming
    • tools

      protected final List<org.springframework.ai.tool.ToolCallback> tools
    • schema

      protected Map<String,Channel<?>> schema
  • Constructor Details

    • ReactAgentBuilder

      public ReactAgentBuilder()
  • Method Details

    • systemMessage

      public Optional<String> systemMessage()
    • tools

      public List<org.springframework.ai.tool.ToolCallback> tools()
    • result

      protected B result()
    • schema

      public B schema(Map<String,Channel<?>> schema)
    • stateSerializer

      public B stateSerializer(StateSerializer<State> stateSerializer)
      Sets the state serializer for the graph builder.
      Parameters:
      stateSerializer - the state serializer to set
      Returns:
      the current instance of GraphBuilder for method chaining
    • chatModel

      public B chatModel(org.springframework.ai.chat.model.ChatModel chatModel, boolean streaming)
    • chatModel

      public B chatModel(org.springframework.ai.chat.model.ChatModel chatModel)
    • defaultSystem

      public B defaultSystem(String systemMessage)
    • tool

      public B tool(org.springframework.ai.tool.ToolCallback tool)
    • tools

      public B tools(List<org.springframework.ai.tool.ToolCallback> tools)
    • tools

      public B tools(org.springframework.ai.tool.ToolCallbackProvider toolCallbackProvider)
    • toolsFromObject

      public B toolsFromObject(Object objectWithTools)
    • build

      public abstract StateGraph<State> build(Function<ReactAgentBuilder<?,?>,ReactAgent.ChatService> chatServiceFactory) throws GraphStateException
      Throws:
      GraphStateException
    • build

      public final StateGraph<State> build() throws GraphStateException
      Throws:
      GraphStateException