pub struct AnthropicMessage {
pub role: String,
pub content: AnthropicContent,
}Fields§
§role: String§content: AnthropicContentImplementations§
Source§impl AnthropicMessage
impl AnthropicMessage
Sourcepub fn tool_uses(&self) -> impl Iterator<Item = (&str, &str)> + '_
pub fn tool_uses(&self) -> impl Iterator<Item = (&str, &str)> + '_
Iterator over (id, name) of tool_use blocks in this assistant
message. Empty for non-assistant messages and for messages whose
content is plain text.
Sourcepub fn tool_result_ids(&self) -> impl Iterator<Item = &str> + '_
pub fn tool_result_ids(&self) -> impl Iterator<Item = &str> + '_
Iterator over tool_use_id of tool_result blocks in this user
message. Empty for non-user messages and for plain-text content.
Sourcepub fn is_tool_result_only_user(&self) -> bool
pub fn is_tool_result_only_user(&self) -> bool
True when this is a user message whose blocks are all tool_results.
Used to recognise dispatch-result messages that can be coalesced.
Trait Implementations§
Source§impl Clone for AnthropicMessage
impl Clone for AnthropicMessage
Source§fn clone(&self) -> AnthropicMessage
fn clone(&self) -> AnthropicMessage
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 AnthropicMessage
impl Debug for AnthropicMessage
Source§impl<'de> Deserialize<'de> for AnthropicMessage
impl<'de> Deserialize<'de> for AnthropicMessage
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 AnthropicMessage
impl RefUnwindSafe for AnthropicMessage
impl Send for AnthropicMessage
impl Sync for AnthropicMessage
impl Unpin for AnthropicMessage
impl UnsafeUnpin for AnthropicMessage
impl UnwindSafe for AnthropicMessage
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