pub struct ImageContent {
pub meta: Option<Map<String, Value>>,
pub annotations: Option<Annotations>,
pub data: String,
pub mime_type: String,
pub type: ImageType,
}Expand description
An image provided to or from an LLM.
Fields§
§meta: Option<Map<String, Value>>§annotations: Option<Annotations>Optional annotations for the client.
data: StringThe base64-encoded image data.
mime_type: StringThe MIME type of the image. Different providers may support different image types.
type: ImageTypeImplementations§
Source§impl ImageContent
impl ImageContent
Sourcepub fn new(data: String, mime_type: String) -> ImageContent
pub fn new(data: String, mime_type: String) -> ImageContent
Creates a value from its required fields; optional fields are None.
Trait Implementations§
Source§impl Clone for ImageContent
impl Clone for ImageContent
Source§fn clone(&self) -> ImageContent
fn clone(&self) -> ImageContent
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 ImageContent
impl Debug for ImageContent
Source§impl<'de> Deserialize<'de> for ImageContent
impl<'de> Deserialize<'de> for ImageContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ImageContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ImageContent> for ContentBlock
impl From<ImageContent> for ContentBlock
Source§fn from(v: ImageContent) -> ContentBlock
fn from(v: ImageContent) -> ContentBlock
Converts to this type from the input type.
Source§impl From<ImageContent> for CreateMessageResultContent
impl From<ImageContent> for CreateMessageResultContent
Source§fn from(v: ImageContent) -> CreateMessageResultContent
fn from(v: ImageContent) -> CreateMessageResultContent
Converts to this type from the input type.
Source§impl From<ImageContent> for SamplingMessageContent
impl From<ImageContent> for SamplingMessageContent
Source§fn from(v: ImageContent) -> SamplingMessageContent
fn from(v: ImageContent) -> SamplingMessageContent
Converts to this type from the input type.
Source§impl From<ImageContent> for SamplingMessageContentBlock
impl From<ImageContent> for SamplingMessageContentBlock
Source§fn from(v: ImageContent) -> SamplingMessageContentBlock
fn from(v: ImageContent) -> SamplingMessageContentBlock
Converts to this type from the input type.
Source§impl IntoContent for ImageContent
impl IntoContent for ImageContent
Source§fn into_content(self) -> ContentBlock
fn into_content(self) -> ContentBlock
Performs the conversion.
Source§impl PartialEq for ImageContent
impl PartialEq for ImageContent
Source§impl Serialize for ImageContent
impl Serialize for ImageContent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ImageContent
Auto Trait Implementations§
impl Freeze for ImageContent
impl RefUnwindSafe for ImageContent
impl Send for ImageContent
impl Sync for ImageContent
impl Unpin for ImageContent
impl UnsafeUnpin for ImageContent
impl UnwindSafe for ImageContent
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