#[non_exhaustive]pub enum UserContentPart {
Text {
text: String,
},
ImageUrl {
image_url: ImageUrlDetail,
},
File {
file_id: Option<String>,
file_data: Option<String>,
filename: Option<String>,
},
}Expand description
A content part within a multimodal user message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text
Text content part.
ImageUrl
Image content part (URL or base64).
Fields
§
image_url: ImageUrlDetailImage URL details.
File
File content part (uploaded file ID or inline base64).
Implementations§
Source§impl UserContentPart
impl UserContentPart
Sourcepub fn image_url_with_detail(
url: impl Into<String>,
detail: ImageDetail,
) -> Self
pub fn image_url_with_detail( url: impl Into<String>, detail: ImageDetail, ) -> Self
Create an image URL content part with detail level.
Trait Implementations§
Source§impl Clone for UserContentPart
impl Clone for UserContentPart
Source§fn clone(&self) -> UserContentPart
fn clone(&self) -> UserContentPart
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 UserContentPart
impl Debug for UserContentPart
Source§impl<'de> Deserialize<'de> for UserContentPart
impl<'de> Deserialize<'de> for UserContentPart
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
impl Eq for UserContentPart
Source§impl PartialEq for UserContentPart
impl PartialEq for UserContentPart
Source§impl Serialize for UserContentPart
impl Serialize for UserContentPart
impl StructuralPartialEq for UserContentPart
Auto Trait Implementations§
impl Freeze for UserContentPart
impl RefUnwindSafe for UserContentPart
impl Send for UserContentPart
impl Sync for UserContentPart
impl Unpin for UserContentPart
impl UnsafeUnpin for UserContentPart
impl UnwindSafe for UserContentPart
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.