pub struct LlmMessage {
pub role: MessageRole,
pub content: MessageContent,
pub metadata: Option<HashMap<String, Value>>,
}Expand description
Represents a message in an LLM conversation
Fields§
§role: MessageRoleRole of the message sender
content: MessageContentContent of the message
metadata: Option<HashMap<String, Value>>Optional metadata
Implementations§
Source§impl LlmMessage
impl LlmMessage
Sourcepub fn has_tool_use(&self) -> bool
pub fn has_tool_use(&self) -> bool
Check if the message contains tool use
Sourcepub fn get_tool_uses(&self) -> Vec<&ContentBlock>
pub fn get_tool_uses(&self) -> Vec<&ContentBlock>
Extract tool use blocks from the message
Trait Implementations§
Source§impl Clone for LlmMessage
impl Clone for LlmMessage
Source§fn clone(&self) -> LlmMessage
fn clone(&self) -> LlmMessage
Returns a duplicate of the value. Read more
1.0.0 · 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 LlmMessage
impl Debug for LlmMessage
Source§impl<'de> Deserialize<'de> for LlmMessage
impl<'de> Deserialize<'de> for LlmMessage
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 LlmMessage
impl RefUnwindSafe for LlmMessage
impl Send for LlmMessage
impl Sync for LlmMessage
impl Unpin for LlmMessage
impl UnwindSafe for LlmMessage
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