fim Completion Stream
Streams Fill-In-the-Middle (FIM) completions chunk by chunk from the DeepSeek API.
This function handles the low-level streaming communication with the API, allowing you to receive and process completions in real-time as they're generated.
Example:
val params = fimCompletionStreamParams { suffix = "}" }
val request = params.createRequest("function calculate(x, y) {")
client.fimCompletionStream(request).collect { chunk ->
print(chunk.choices.firstOrNull()?.text ?: "")
}Content copied to clipboard
Return
A Flow of FIMCompletion objects representing incremental updates
Parameters
request
The FIM completion request with streaming enabled
Throws
from the returned Flow's collector if the API returns a non-2xx status