pub trait StreamingChatProvider: ChatCompletionProvider {
type Delta<'s>: Stream<Item = Result<String>> + Send + 's
where Self: 's;
// Required method
fn chat_complete_stream<'p, M>(
&self,
params: ChatCompleteParameters<M>,
) -> Self::Delta<'p>
where M: Into<Self::Message> + Send + Sync + 'p;
}Expand description
A provider that can deliver the model’s answer incrementally.
The stream yields UTF-8 text deltas (similar to OpenAI’s SSE format). Tool-call and richer payload support can be layered on later by introducing a dedicated enum – starting with plain text keeps the API minimal and backend-agnostic.
Required Associated Types§
Required Methods§
Sourcefn chat_complete_stream<'p, M>(
&self,
params: ChatCompleteParameters<M>,
) -> Self::Delta<'p>
fn chat_complete_stream<'p, M>( &self, params: ChatCompleteParameters<M>, ) -> Self::Delta<'p>
Start a streaming chat completion.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.