> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# streaming • Rust AI Agent SDK

> Streaming Module

# streaming

<Badge color="orange">Rust AI Agent SDK</Badge>

Streaming Module

This module provides streaming event handling for LLM responses:

* `StreamEvent` - Streaming event representation
* `StreamEventType` - Types of streaming events
* `StreamMetrics` - Timing metrics for streaming
* `StreamCallback` - Callback trait for handling events

# Example

```ignore theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::streaming::{StreamEvent, StreamEventType, StreamMetrics};

let event = StreamEvent::new(StreamEventType::DeltaText)
.content("Hello");

let mut metrics = StreamMetrics::default();
metrics.update_from_event(&event);
```

## Import

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
use praisonai::streaming::*;
```

## Classes

<CardGroup cols={2}>
  <Card title="ToolCallData" icon="brackets-curly" href="../classes/ToolCallData">
    Tool call data for streaming events.
  </Card>

  <Card title="StreamEvent" icon="brackets-curly" href="../classes/StreamEvent">
    A single streaming event emitted during LLM response streaming.
  </Card>

  <Card title="StreamMetrics" icon="brackets-curly" href="../classes/StreamMetrics">
    Timing metrics for a streaming response.
  </Card>

  <Card title="StreamHandler" icon="brackets-curly" href="../classes/StreamHandler">
    Handler for managing stream callbacks.
  </Card>

  <Card title="StreamCollector" icon="brackets-curly" href="../classes/StreamCollector">
    Collects stream events and accumulated content.
  </Card>

  <Card title="StreamCallback" icon="brackets-curly" href="../classes/StreamCallback">
    Trait for synchronous stream event callbacks.
  </Card>

  <Card title="AsyncStreamCallback" icon="brackets-curly" href="../classes/AsyncStreamCallback">
    Trait for asynchronous stream event callbacks.
  </Card>

  <Card title="StreamEventType" icon="brackets-curly" href="../classes/StreamEventType">
    Types of streaming events emitted during LLM response streaming.
  </Card>
</CardGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Streaming" icon="wave-square" href="/docs/rust/streaming" />

  <Card title="Rust Realtime" icon="clock" href="/docs/rust/realtime" />

  <Card title="Rust Display" icon="display" href="/docs/rust/display" />
</CardGroup>
