pub struct ContentPart {
pub content_type: ContentType,
pub text: Option<String>,
pub image_url: Option<ImageUrl>,
pub input_audio: Option<InputAudio>,
pub video_url: Option<VideoUrl>,
}Expand description
Content part for multi-modal messages.
Fields§
§content_type: ContentTypeContent type
text: Option<String>Text content (for text type)
image_url: Option<ImageUrl>Image URL (for image type)
input_audio: Option<InputAudio>Input audio (for audio type)
video_url: Option<VideoUrl>Video URL (for video type)
Implementations§
Source§impl ContentPart
impl ContentPart
Sourcepub fn image_base64(media_type: &str, data: impl Into<String>) -> Self
pub fn image_base64(media_type: &str, data: impl Into<String>) -> Self
Create an image content part from base64 data.
Sourcepub fn audio_base64(data: impl Into<String>) -> Self
pub fn audio_base64(data: impl Into<String>) -> Self
Create an audio content part from base64 data.
Trait Implementations§
Source§impl Clone for ContentPart
impl Clone for ContentPart
Source§fn clone(&self) -> ContentPart
fn clone(&self) -> ContentPart
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 ContentPart
impl Debug for ContentPart
Source§impl<'de> Deserialize<'de> for ContentPart
impl<'de> Deserialize<'de> for ContentPart
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 ContentPart
impl RefUnwindSafe for ContentPart
impl Send for ContentPart
impl Sync for ContentPart
impl Unpin for ContentPart
impl UnsafeUnpin for ContentPart
impl UnwindSafe for ContentPart
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