Class StreamingChatGenerator<State extends AgentState>

java.lang.Object
org.bsc.langgraph4j.langchain4j.generators.StreamingChatGenerator<State>
All Implemented Interfaces:
Iterable<StreamingOutput<State>>, org.bsc.async.AsyncGenerator<StreamingOutput<State>>, org.bsc.async.AsyncGenerator.HasResultValue, LG4JLoggable

public class StreamingChatGenerator<State extends AgentState> extends Object implements org.bsc.async.AsyncGenerator<StreamingOutput<State>>, org.bsc.async.AsyncGenerator.HasResultValue, LG4JLoggable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder class for constructing instances of LLMStreamingGenerator.

    Nested classes/interfaces inherited from interface org.bsc.async.AsyncGenerator

    org.bsc.async.AsyncGenerator.Base<E extends Object>, org.bsc.async.AsyncGenerator.BaseCancellable<E extends Object>, org.bsc.async.AsyncGenerator.Cancellable<E extends Object>, org.bsc.async.AsyncGenerator.Data<E extends Object>, org.bsc.async.AsyncGenerator.Embed<E extends Object>, org.bsc.async.AsyncGenerator.EmbedCompletionHandler, org.bsc.async.AsyncGenerator.HasResultValue, org.bsc.async.AsyncGenerator.IsCancellable, org.bsc.async.AsyncGenerator.ReduceResult<E extends Object>, org.bsc.async.AsyncGenerator.WithEmbed<E extends Object>, org.bsc.async.AsyncGenerator.WithResult<E extends Object>
  • Field Summary

    Fields inherited from interface org.bsc.langgraph4j.LG4JLoggable

    log
  • Method Summary

    Modifier and Type
    Method
    Description
    static <State extends AgentState>
    StreamingChatGenerator.Builder<State>
    Creates a new Builder instance for LLMStreamingGenerator.
    final Executor
     
    dev.langchain4j.model.chat.response.StreamingChatResponseHandler
    Returns the StreamingResponseHandler associated with this generator.
    final org.bsc.async.AsyncGenerator.Data<StreamingOutput<State>>
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.bsc.async.AsyncGenerator

    flatMap, forEachAsync, iterator, map, reduce, reduce, reduceAsync, reduceAsync, stream, toCompletableFuture, toCompletableFutureAsync

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Method Details

    • builder

      public static <State extends AgentState> StreamingChatGenerator.Builder<State> builder()
      Creates a new Builder instance for LLMStreamingGenerator.
      Type Parameters:
      State - the type of the state extending AgentState
      Returns:
      a new Builder instance
    • next

      public final org.bsc.async.AsyncGenerator.Data<StreamingOutput<State>> next()
      Specified by:
      next in interface org.bsc.async.AsyncGenerator<State extends AgentState>
    • executor

      public final Executor executor()
      Specified by:
      executor in interface org.bsc.async.AsyncGenerator<State extends AgentState>
    • resultValue

      public final Optional<Object> resultValue()
      Specified by:
      resultValue in interface org.bsc.async.AsyncGenerator.HasResultValue
    • handler

      public dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler()
      Returns the StreamingResponseHandler associated with this generator.
      Returns:
      the handler for streaming responses