OpenaiChatResponseSpecification

class OpenaiChatResponseSpecification(var assistantContent: String = "", var responseFlow: Flow<String>? = null, var responseChunks: List<String>? = null, var delayBetweenChunks: Duration = Duration.ZERO, delay: Duration = Duration.ZERO, var finishReason: String = "stop") : AbstractResponseSpecification<ChatCompletionRequest, ChatResponse> (source)

A specification class for defining and customizing the response to a chat completion request in an OpenAI-like conversational environment. Allows the configuration of the assistant response content, response handling flow, chunking behavior, delays, and the designated finish reason.

This class extends ResponseSpecification and provides additional parameters specific to OpenAI chat responses such as assistant content manipulation and timing controls.

Author

Konstantin Pavlov

Parameters

assistantContent

The initial assistant response content.

responseFlow

A flow of string-based response chunks to be emitted sequentially.

responseChunks

A list of pre-defined response content chunks.

delayBetweenChunks

The delay applied between emitting each response chunk from the flow.

delay

The global delay applied to the response before sending it.

finishReason

The reason indicating why the completion process finished, such as "stop".

See also

Constructors

Link copied to clipboard
constructor(assistantContent: String = "", responseFlow: Flow<String>? = null, responseChunks: List<String>? = null, delayBetweenChunks: Duration = Duration.ZERO, delay: Duration = Duration.ZERO, finishReason: String = "stop")

Creates an instance of OpenaiChatResponseSpecification.

Properties

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

Functions

Link copied to clipboard
open override fun delayMillis(value: Long)
Link copied to clipboard