GeminiStreamingContentResponseSpecification

class GeminiStreamingContentResponseSpecification(responseFlow: Flow<String>? = null, responseChunks: List<String>? = null, delayBetweenChunks: Duration = Duration.ZERO, delay: Duration = Duration.ZERO, var finishReason: String = "STOP") : AbstractStreamingResponseSpecification<GenerateContentRequest, String, String> (source)

Specification for configuring a streaming Gemini content generation response.

This class provides a fluent API for configuring the streaming response that will be returned by the mock Gemini API when a content generation request is made with streaming enabled.

Constructors

constructor(responseFlow: Flow<String>? = null, responseChunks: List<String>? = null, delayBetweenChunks: Duration = Duration.ZERO, delay: Duration = Duration.ZERO, finishReason: String = "STOP")

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The reason why the model stopped generating tokens.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun chunks(chunks: List<String>)
open override fun chunks(vararg chunks: String)
Link copied to clipboard
open override fun delayMillis(value: Long)
Link copied to clipboard

Sets the finish reason for the streaming response.

Link copied to clipboard
open override fun stream(stream: Stream<String>)