Class OpenAiStreamingResponseBuilder

java.lang.Object
dev.langchain4j.model.openai.OpenAiStreamingResponseBuilder

public class OpenAiStreamingResponseBuilder extends Object
This class needs to be thread safe because it is called when a streaming result comes back and there is no guarantee that this thread will be the same as the one that initiated the request, in fact it almost certainly won't be.
  • Constructor Details

    • OpenAiStreamingResponseBuilder

      public OpenAiStreamingResponseBuilder()
  • Method Details

    • append

      public void append(dev.ai4j.openai4j.chat.ChatCompletionResponse partialResponse)
    • append

      public void append(dev.ai4j.openai4j.completion.CompletionResponse partialResponse)
    • build

      public Response<AiMessage> build()