pub struct Message {
pub role: Role,
pub content: Vec<Block>,
pub timestamp: DateTime<Utc>,
pub model: Option<String>,
pub stop_reason: Option<StopReason>,
pub usage: Option<Usage>,
}Expand description
One turn in the conversation: a role and its content blocks, plus the assistant-only attribution fields when present.
Fields§
§role: Role§content: Vec<Block>§timestamp: DateTime<Utc>§model: Option<String>Model that produced this turn (assistant only).
stop_reason: Option<StopReason>Why the turn ended (assistant only).
usage: Option<Usage>Token accounting for the turn (assistant only).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnsafeUnpin for Message
impl UnwindSafe for Message
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