Skip to main content

StreamFn

Trait StreamFn 

Source
pub trait StreamFn: Send + Sync {
    // Required method
    fn stream<'a>(
        &'a self,
        model: &'a Model,
        context: &'a TranscriptContext,
        options: &'a SimpleStreamOptions,
        sink: &'a mut EventSink<'_>,
    ) -> BoxFuture<'a, AssistantMessage>;
}
Expand description

StreamFn: one model response, events to sink, the final message returned (errors are messages).

Required Methods§

Source

fn stream<'a>( &'a self, model: &'a Model, context: &'a TranscriptContext, options: &'a SimpleStreamOptions, sink: &'a mut EventSink<'_>, ) -> BoxFuture<'a, AssistantMessage>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§