Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.praison.ai/llms.txt

Use this file to discover all available pages before exploring further.

StreamCollector

Defined in the streaming module.
Rust AI Agent SDK Collects stream events and accumulated content.

Fields

NameTypeDescription
eventsVec<StreamEvent>Collected events
contentStringAccumulated content
metricsStreamMetricsMetrics

Methods

new

fn new() -> Self
Create a new collector

process

fn process(&mut self, event: StreamEvent) -> ()
Process an event Parameters:
NameType
eventStreamEvent

get_content

fn get_content(&self) -> &str
Get final content

event_count

fn event_count(&self) -> usize
Get event count

is_complete

fn is_complete(&self) -> bool
Check if streaming completed successfully

has_error

fn has_error(&self) -> bool
Check if there was an error

get_error

fn get_error(&self) -> Option<&str>
Get error message if any

Source

View on GitHub

praisonai/src/streaming/mod.rs at line 424