Header menu logo Nao

LlmProvider Module

Helpers for invoking providers.

Functions and values

Function or value Description

LlmProvider.streamAsync provider conversation options onChunk

Full Usage: LlmProvider.streamAsync provider conversation options onChunk

Parameters:
Returns: Task<CompletionResult>

Stream a completion, delivering each delta to `onChunk`. When the provider implements `IStreamingLlmProvider` the real token stream is used; otherwise this falls back to a single buffered `CompleteAsync` call and emits the whole response as one chunk. Callers can therefore always use the streaming path regardless of the provider's capability.

provider : ILlmProvider
conversation : Conversation
options : CompletionOptions
onChunk : CompletionChunk -> unit
Returns: Task<CompletionResult>

Type something to start searching.