pub enum ContentPart {
Text {
text: String,
},
Image {
image_url: ImageUrl,
},
Audio {
input_audio: AudioInput,
},
Video {
video_url: VideoUrl,
},
}Expand description
A single part of message content
Variants§
Text
Text content
Image
Image content
Audio
Audio content (for models that support it)
Fields
§
input_audio: AudioInputVideo
Video content (for models that support it)
Implementations§
Source§impl ContentPart
impl ContentPart
Sourcepub fn audio(audio: &AudioData) -> Self
pub fn audio(audio: &AudioData) -> Self
Create an audio content part from AudioData.
For URL-backed audio the URL is sent verbatim in data with format
omitted (the "url" sentinel never reaches the wire); for inline audio
the base64 data and real format are sent.
Sourcepub fn from_media(media: &Media) -> Self
pub fn from_media(media: &Media) -> Self
Create a content part from any Media type
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 (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 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