pub trait StreamingChatProvider: ChatCompletionProvider {
type Delta<'s>: Stream<Item = Result<String>> + Send + 's
where Self: 's;
// Required method
fn chat_complete_stream<'s, M>(
&'s self,
params: ChatCompleteParameters<M>,
) -> Self::Delta<'s>
where M: Into<Self::Message> + Clone + Send + Sync + 's;
}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<'s, M>(
&'s self,
params: ChatCompleteParameters<M>,
) -> Self::Delta<'s>
fn chat_complete_stream<'s, M>( &'s self, params: ChatCompleteParameters<M>, ) -> Self::Delta<'s>
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.