chat Completion Stream Params
fun chatCompletionStreamParams(block: ChatCompletionParams.StreamBuilder.() -> Unit): ChatCompletionParams
Creates streaming chat completion parameters using a builder pattern.
This function provides a convenient way to configure streaming chat completion parameters using Kotlin's DSL-style builder syntax. The resulting parameters will have stream
set to true
automatically.
Example:
val streamParams = chatCompletionStreamParams {
model = ChatModel.DEEPSEEK_CHAT
temperature = 0.7
streamOptions = StreamOptions(chunkSize = 10)
}
client.chatStream(streamParams, messages).collect { chunk ->
print(chunk.choices.firstOrNull()?.delta?.content ?: "")
}
Content copied to clipboard
Return
Configured ChatCompletionParams instance with streaming enabled
Parameters
block
Configuration block for setting parameter values