pub struct MessageAlternative {
pub content: String,
pub images: Vec<ImageRef>,
pub content_blocks: Vec<ContentBlock>,
pub timestamp: 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: StringImplementations§
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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MessageAlternative
impl PartialEq for MessageAlternative
Source§fn eq(&self, other: &MessageAlternative) -> bool
fn eq(&self, other: &MessageAlternative) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MessageAlternative
impl Serialize for MessageAlternative
impl StructuralPartialEq for MessageAlternative
Auto Trait Implementations§
impl Freeze for MessageAlternative
impl RefUnwindSafe for MessageAlternative
impl Send for MessageAlternative
impl Sync for MessageAlternative
impl Unpin for MessageAlternative
impl UnsafeUnpin for MessageAlternative
impl UnwindSafe for MessageAlternative
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