pub trait StreamingChat<R: Clone + Unpin>: Send + Sync {
// Required method
fn stream_chat(
&self,
prompt: impl Into<Message> + Send,
chat_history: Vec<Message>,
) -> impl Future<Output = Result<StreamingCompletionResponse<R>, CompletionError>>;
}
Expand description
Trait for high-level streaming chat interface
Required Methods§
Sourcefn stream_chat(
&self,
prompt: impl Into<Message> + Send,
chat_history: Vec<Message>,
) -> impl Future<Output = Result<StreamingCompletionResponse<R>, CompletionError>>
fn stream_chat( &self, prompt: impl Into<Message> + Send, chat_history: Vec<Message>, ) -> impl Future<Output = Result<StreamingCompletionResponse<R>, CompletionError>>
Stream a chat with history to the model
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.