pub struct Message {
pub role: String,
pub content: String,
}Fields§
§role: String§content: StringImplementations§
Source§impl Message
impl Message
pub fn new(role: impl Into<String>, content: impl Into<String>) -> Self
Sourcepub fn is_tool_call(&self) -> bool
pub fn is_tool_call(&self) -> bool
Check if this message contains a tool_use content block This is a lightweight check that looks for the “type”:“tool_use” pattern in content
Sourcepub fn is_tool_result(&self) -> bool
pub fn is_tool_result(&self) -> bool
Check if this message contains a tool_result content block This is a lightweight check that looks for the “type”:“tool_result” pattern in content
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 Eq for Message
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