forgeai-stream 0.1.1

Streaming protocol types for forgeai-rs
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 16.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.72 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 50s Average build duration of successful builds.
  • all releases: 42s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • viralkachhadiya/forgeai-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • viralkachhadiya

forgeai-stream

Streaming protocol helpers for forgeai-rs.

This crate currently re-exports forgeai_core::StreamEvent.

Example

use forgeai_stream::StreamEvent;

fn handle(event: StreamEvent) {
    match event {
        StreamEvent::TextDelta { delta } => println!("{delta}"),
        StreamEvent::Usage { usage } => println!("total tokens: {}", usage.total_tokens),
        StreamEvent::ToolCallDelta { .. } => {}
        StreamEvent::Done => {}
    }
}