#[non_exhaustive]pub enum ModelStreamEvent {
MessageStart(ModelMessageStartEvent),
ContentBlockStart(ModelContentBlockStartEvent),
ContentBlockDelta(ModelContentBlockDeltaEvent),
ContentBlockStop(ModelContentBlockStopEvent),
MessageStop(ModelMessageStopEvent),
Metadata(ModelMetadataEvent),
Redaction(ModelRedactionEvent),
}Expand description
An event in a model’s response stream (ModelStreamEvent).
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.
MessageStart(ModelMessageStartEvent)
The model started a message.
ContentBlockStart(ModelContentBlockStartEvent)
A content block started.
ContentBlockDelta(ModelContentBlockDeltaEvent)
A content block received a delta.
ContentBlockStop(ModelContentBlockStopEvent)
A content block ended.
MessageStop(ModelMessageStopEvent)
The message ended.
Metadata(ModelMetadataEvent)
Usage, metrics and trace data.
Redaction(ModelRedactionEvent)
A guardrail redacted content.
Trait Implementations§
Source§impl Clone for ModelStreamEvent
impl Clone for ModelStreamEvent
Source§impl Debug for ModelStreamEvent
impl Debug for ModelStreamEvent
Source§impl<'de> Deserialize<'de> for ModelStreamEvent
impl<'de> Deserialize<'de> for ModelStreamEvent
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
Source§impl From<ModelContentBlockDeltaEvent> for ModelStreamEvent
impl From<ModelContentBlockDeltaEvent> for ModelStreamEvent
Source§fn from(event: ModelContentBlockDeltaEvent) -> Self
fn from(event: ModelContentBlockDeltaEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelContentBlockStartEvent> for ModelStreamEvent
impl From<ModelContentBlockStartEvent> for ModelStreamEvent
Source§fn from(event: ModelContentBlockStartEvent) -> Self
fn from(event: ModelContentBlockStartEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelContentBlockStopEvent> for ModelStreamEvent
impl From<ModelContentBlockStopEvent> for ModelStreamEvent
Source§fn from(event: ModelContentBlockStopEvent) -> Self
fn from(event: ModelContentBlockStopEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelMessageStartEvent> for ModelStreamEvent
impl From<ModelMessageStartEvent> for ModelStreamEvent
Source§fn from(event: ModelMessageStartEvent) -> Self
fn from(event: ModelMessageStartEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelMessageStopEvent> for ModelStreamEvent
impl From<ModelMessageStopEvent> for ModelStreamEvent
Source§fn from(event: ModelMessageStopEvent) -> Self
fn from(event: ModelMessageStopEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelMetadataEvent> for ModelStreamEvent
impl From<ModelMetadataEvent> for ModelStreamEvent
Source§fn from(event: ModelMetadataEvent) -> Self
fn from(event: ModelMetadataEvent) -> Self
Converts to this type from the input type.
Source§impl From<ModelRedactionEvent> for ModelStreamEvent
impl From<ModelRedactionEvent> for ModelStreamEvent
Source§fn from(event: ModelRedactionEvent) -> Self
fn from(event: ModelRedactionEvent) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ModelStreamEvent
impl PartialEq for ModelStreamEvent
Source§impl Serialize for ModelStreamEvent
impl Serialize for ModelStreamEvent
impl StructuralPartialEq for ModelStreamEvent
Auto Trait Implementations§
impl Freeze for ModelStreamEvent
impl RefUnwindSafe for ModelStreamEvent
impl Send for ModelStreamEvent
impl Sync for ModelStreamEvent
impl Unpin for ModelStreamEvent
impl UnsafeUnpin for ModelStreamEvent
impl UnwindSafe for ModelStreamEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.