#[non_exhaustive]pub enum UnifiedStreamEvent {
ContentDelta(String),
ReasoningDelta(String),
ReasoningDetailsDelta(Vec<ReasoningDetail>),
ToolDelta(Value),
Raw {
source: UnifiedStreamSource,
event_type: String,
data: Value,
},
Done {
source: UnifiedStreamSource,
id: Option<String>,
model: Option<String>,
finish_reason: Option<String>,
usage: Option<Value>,
},
Error(OpenRouterError),
}Expand description
Unified stream event model across chat/responses/messages APIs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
ContentDelta(String)
Text content delta from the model.
ReasoningDelta(String)
Reasoning/thinking delta.
ReasoningDetailsDelta(Vec<ReasoningDetail>)
Structured reasoning detail blocks (chat stream only).
ToolDelta(Value)
Tool-related delta payload (format depends on source API).
Raw
Source-specific event payload when no common projection applies.
Done
Terminal event for a stream source.
Fields
§
source: UnifiedStreamSourceError(OpenRouterError)
Transport/parsing/runtime error from the underlying stream.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UnifiedStreamEvent
impl !UnwindSafe for UnifiedStreamEvent
impl Freeze for UnifiedStreamEvent
impl Send for UnifiedStreamEvent
impl Sync for UnifiedStreamEvent
impl Unpin for UnifiedStreamEvent
impl UnsafeUnpin for UnifiedStreamEvent
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