pub enum StreamEventPayload {
MessageStart {
message: Value,
},
ContentBlockStart {
index: u64,
content_block: ContentBlockInfo,
},
ContentBlockDelta {
index: u64,
delta: Delta,
},
ContentBlockStop {
index: u64,
},
MessageDelta {
delta: Value,
usage: Option<Value>,
},
MessageStop,
Unknown,
}Expand description
The inner event payload from the Anthropic streaming API.
This mirrors the Server-Sent Events that the Anthropic API emits.
Variants§
MessageStart
Signals the start of a new message, includes message metadata.
ContentBlockStart
Signals the start of a content block at the given index.
Fields
§
content_block: ContentBlockInfoThe initial content block (type, and any initial data).
ContentBlockDelta
An incremental update to the content block at the given index.
Fields
ContentBlockStop
Signals that the content block at the given index is complete.
MessageDelta
An update to the top-level message (e.g. stop_reason, usage).
MessageStop
Signals that the entire message is complete.
Unknown
Catch-all for forward-compatibility with unknown event types.
Trait Implementations§
Source§impl Clone for StreamEventPayload
impl Clone for StreamEventPayload
Source§fn clone(&self) -> StreamEventPayload
fn clone(&self) -> StreamEventPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamEventPayload
impl Debug for StreamEventPayload
Source§impl<'de> Deserialize<'de> for StreamEventPayload
impl<'de> Deserialize<'de> for StreamEventPayload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StreamEventPayload
impl RefUnwindSafe for StreamEventPayload
impl Send for StreamEventPayload
impl Sync for StreamEventPayload
impl Unpin for StreamEventPayload
impl UnsafeUnpin for StreamEventPayload
impl UnwindSafe for StreamEventPayload
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