pub struct Message {
pub role: Role,
pub content: String,
pub parts: Vec<MessagePart>,
pub metadata: MessageMetadata,
}Fields§
§role: Role§content: String§parts: Vec<MessagePart>§metadata: MessageMetadataImplementations§
Source§impl Message
impl Message
pub fn from_legacy(role: Role, content: impl Into<String>) -> Self
pub fn from_parts(role: Role, parts: Vec<MessagePart>) -> Self
pub fn to_llm_content(&self) -> &str
Sourcepub fn rebuild_content(&mut self)
pub fn rebuild_content(&mut self)
Re-synchronize content from parts after in-place mutation.
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
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