Class TokenStreamExtensionsKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow, Boolean includeCompleteResponse) Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.
      final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow) Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.
      final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity) Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.
      final static Flow<String> asFlow(TokenStream $self) Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.
      final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow) Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.
      final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self, Integer bufferCapacity) Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.
      final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self) Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • asFlow

        @JvmOverloads() final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow, Boolean includeCompleteResponse)

        Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.

        Parameters:
        bufferCapacity - The capacity of the buffer used in the flow to control backpressure.
        Returns:

        A Flow emitting strings, where each string represents a partial response from the associated language model.

      • asFlow

        @JvmOverloads() final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow)

        Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.

        Parameters:
        bufferCapacity - The capacity of the buffer used in the flow to control backpressure.
        Returns:

        A Flow emitting strings, where each string represents a partial response from the associated language model.

      • asFlow

        @JvmOverloads() final static Flow<String> asFlow(TokenStream $self, Integer bufferCapacity)

        Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.

        Parameters:
        bufferCapacity - The capacity of the buffer used in the flow to control backpressure.
        Returns:

        A Flow emitting strings, where each string represents a partial response from the associated language model.

      • asFlow

        @JvmOverloads() final static Flow<String> asFlow(TokenStream $self)

        Converts a TokenStream into a Flow of strings which emits partial responses as they are streamed, and closes when the stream is complete or encounters an error.

        Returns:

        A Flow emitting strings, where each string represents a partial response from the associated language model.

      • asReplyFlow

        @JvmOverloads() final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self, Integer bufferCapacity, BufferOverflow onBufferOverflow)

        Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.

        This function utilizes a coroutine-based flow to provide real-time updates of the streaming response. The flow handles partial responses, the final complete response, and errors that may occur during the streaming process. Responses are buffered with the specified capacity.

        Parameters:
        bufferCapacity - The capacity of the flow buffer, which determines how many items can be collected before backpressure occurs.
        Returns:

        A Flow that will emit StreamingChatModelReply instances including partial responses, complete responses, or errors in the order they are received.

      • asReplyFlow

        @JvmOverloads() final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self, Integer bufferCapacity)

        Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.

        This function utilizes a coroutine-based flow to provide real-time updates of the streaming response. The flow handles partial responses, the final complete response, and errors that may occur during the streaming process. Responses are buffered with the specified capacity.

        Parameters:
        bufferCapacity - The capacity of the flow buffer, which determines how many items can be collected before backpressure occurs.
        Returns:

        A Flow that will emit StreamingChatModelReply instances including partial responses, complete responses, or errors in the order they are received.

      • asReplyFlow

        @JvmOverloads() final static Flow<StreamingChatModelReply> asReplyFlow(TokenStream $self)

        Converts a TokenStream into a Flow of StreamingChatModelReply instances, where each emitted item represents a partial or complete response received during streaming.

        This function utilizes a coroutine-based flow to provide real-time updates of the streaming response. The flow handles partial responses, the final complete response, and errors that may occur during the streaming process. Responses are buffered with the specified capacity.

        Returns:

        A Flow that will emit StreamingChatModelReply instances including partial responses, complete responses, or errors in the order they are received.