Skip to main content

StreamChunkExt

Trait StreamChunkExt 

Source
pub trait StreamChunkExt:
    DeserializeOwned
    + Send
    + 'static {
    // Required method
    fn extract_events(&self) -> Vec<TokenEvent>;
}
Expand description

Extension trait for deserializing raw LLM stream chunks into TokenEvents.

Each provider’s chunk type implements this trait to convert its native response structure into the framework’s unified token event model.

Required Methods§

Source

fn extract_events(&self) -> Vec<TokenEvent>

Extract token-level events (text, tool deltas, finish) from this chunk.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl StreamChunkExt for CreateChatCompletionStreamResponse

Implementors§