pub struct MessageAlternative {
pub content: String,
pub images: Vec<ImageRef>,
pub content_blocks: Vec<ContentBlock>,
pub timestamp: String,
pub provider_key: Option<String>,
}Expand description
Stored alternate body for a regenerated assistant message.
Message keeps the currently selected alternative in its top-level
content/content_blocks fields so existing clients and prompt assembly
keep reading the active response. alternatives stores every selectable
candidate, including the active one.
Fields§
§content: String§images: Vec<ImageRef>§content_blocks: Vec<ContentBlock>§timestamp: String§provider_key: Option<String>Provider key that minted this alternative’s content. A regenerated
assistant body can be produced under a different provider than the
original message or a sibling alternative, so each alternative carries
its own provenance rather than inheriting the single
Message::provider_key. The replay portability filter uses this to
drop opaque thinking data the active provider cannot interpret. None
for alternatives persisted before per-alternative provenance tracking,
in which case callers fall back to Message::provider_key.
Implementations§
Source§impl MessageAlternative
impl MessageAlternative
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Ensure content and content_blocks are consistent after
deserialization, matching Message::normalize.
Trait Implementations§
Source§impl Clone for MessageAlternative
impl Clone for MessageAlternative
Source§fn clone(&self) -> MessageAlternative
fn clone(&self) -> MessageAlternative
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageAlternative
impl Debug for MessageAlternative
Source§impl<'de> Deserialize<'de> for MessageAlternative
impl<'de> Deserialize<'de> for MessageAlternative
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>,
Source§impl PartialEq for MessageAlternative
impl PartialEq for MessageAlternative
Source§fn eq(&self, other: &MessageAlternative) -> bool
fn eq(&self, other: &MessageAlternative) -> bool
self and other values to be equal, and is used by ==.