Class StreamingChatGenerator.Builder<State extends AgentState>

java.lang.Object
org.bsc.langgraph4j.spring.ai.generators.StreamingChatGenerator.Builder<State>
Enclosing class:
StreamingChatGenerator<State extends AgentState>

public static class StreamingChatGenerator.Builder<State extends AgentState> extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • emitStreamingOutputEnd

      public StreamingChatGenerator.Builder<State> emitStreamingOutputEnd(boolean emitStreamingOutputEnd)
    • queue

      public StreamingChatGenerator.Builder<State> queue(BlockingQueue<org.bsc.async.AsyncGenerator.Data<StreamingOutput<State>>> queue)
      Sets the queue for the builder.
      Parameters:
      queue - the blocking queue for async generator data
      Returns:
      the builder instance
    • mapResult

      public StreamingChatGenerator.Builder<State> mapResult(Function<org.springframework.ai.chat.model.ChatResponse,Map<String,Object>> mapResult)
      Sets the mapping function for the builder.
      Parameters:
      mapResult - a function to map the response to a result
      Returns:
      the builder instance
    • startingNode

      public StreamingChatGenerator.Builder<State> startingNode(String node)
      Sets the starting node for the builder.
      Parameters:
      node - the starting node
      Returns:
      the builder instance
    • startingState

      public StreamingChatGenerator.Builder<State> startingState(State state)
      Sets the starting state for the builder.
      Parameters:
      state - the initial state
      Returns:
      the builder instance
    • build

      public org.bsc.async.AsyncGenerator<? extends NodeOutput<State>> build(reactor.core.publisher.Flux<org.springframework.ai.chat.model.ChatResponse> flux)
      Builds and returns an instance of LLMStreamingGenerator.
      Returns:
      a new instance of LLMStreamingGenerator