public completeStreaming(request as LLMRequest, observer as LocalGenerationObserver) as LLMResponse throws Exception
Generates incrementally on the calling thread, with cooperative stopping. Text callbacks contain only new complete Unicode scalars. At cancellation or an output-length boundary, an incomplete trailing scalar is withheld. Model loading is separate and not interruptible. Concurrent calls/close remain unsupported. All generation buffers are freed on stop or exception.
| Parameter | Description |
|---|---|
request | Same typed text/tool contract as complete(). Generated tool markup is withheld from onText and returned as validated ToolCalls. |
observer | Required synchronous observer, including during prefill. |
Partial or full response; finishReason is stop, tool_calls, length or cancelled. Incomplete/stopped calls are never returned for execution. Token counts include a generated EOS, but not unprocessed prompt tokens.
response = provider.completeStreaming(LLMRequest(messages), observer)