pub struct StreamCollector {
pub text: String,
pub message_id: Option<String>,
pub model: Option<String>,
pub usage: Usage,
pub stop_reason: Option<StopReason>,
pub stop_sequence: Option<String>,
}Expand description
Stream collector for aggregating streaming events
Fields§
§text: StringAccumulated text content
message_id: Option<String>Message ID
model: Option<String>Model used
usage: UsageUsage statistics
stop_reason: Option<StopReason>Stop reason
stop_sequence: Option<String>Stop sequence
Implementations§
Source§impl StreamCollector
impl StreamCollector
Sourcepub fn process_event(&mut self, event: StreamEvent) -> bool
pub fn process_event(&mut self, event: StreamEvent) -> bool
Sourcepub fn to_response(self) -> Result<MessageResponse>
pub fn to_response(self) -> Result<MessageResponse>
Convert to MessageResponse
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamCollector
impl RefUnwindSafe for StreamCollector
impl Send for StreamCollector
impl Sync for StreamCollector
impl Unpin for StreamCollector
impl UnsafeUnpin for StreamCollector
impl UnwindSafe for StreamCollector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more