pub trait StreamingChat<M, R>: Send + Syncwhere
M: CompletionModel + 'static,
<M as CompletionModel>::StreamingResponse: Send,
R: Clone + Unpin + GetTokenUsage,{
// Required method
fn stream_chat(
&self,
prompt: impl Into<Message> + Send,
chat_history: Vec<Message>,
) -> StreamingPromptRequest<M, ()>;
}
Expand description
Trait for high-level streaming chat interface
Required Methods§
Sourcefn stream_chat(
&self,
prompt: impl Into<Message> + Send,
chat_history: Vec<Message>,
) -> StreamingPromptRequest<M, ()>
fn stream_chat( &self, prompt: impl Into<Message> + Send, chat_history: Vec<Message>, ) -> StreamingPromptRequest<M, ()>
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.