pub enum Content {
Text {
text: String,
annotations: Option<ContentAnnotations>,
},
Image {
data: String,
mime_type: String,
annotations: Option<ContentAnnotations>,
},
Audio {
data: String,
mime_type: String,
annotations: Option<ContentAnnotations>,
},
Resource {
resource: ResourceContent,
annotations: Option<ContentAnnotations>,
},
ResourceLink {
uri: String,
name: Option<String>,
description: Option<String>,
mime_type: Option<String>,
annotations: Option<ContentAnnotations>,
},
}Expand description
Content types for tool results, resources, and prompts.
Content can be text, images, audio, or embedded resources. Each variant supports optional annotations for audience targeting and priority hints.
Variants§
Text
Plain text content.
Fields
§
annotations: Option<ContentAnnotations>Optional annotations for this content.
Image
Base64-encoded image content.
Fields
§
annotations: Option<ContentAnnotations>Optional annotations for this content.
Audio
Base64-encoded audio content.
Fields
§
annotations: Option<ContentAnnotations>Optional annotations for this content.
Resource
Embedded resource content.
Fields
§
resource: ResourceContentThe embedded resource.
§
annotations: Option<ContentAnnotations>Optional annotations for this content.
ResourceLink
Link to a resource (without embedding the content)
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Content
impl<'de> Deserialize<'de> for Content
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 Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnwindSafe for Content
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