pub struct ImagePart {
pub source: ImageSource,
pub detail: Option<ImageDetail>,
}Expand description
A multimodal image input.
Fields§
§source: ImageSourceWhere the image bytes come from.
detail: Option<ImageDetail>Optional processing-detail hint.
Implementations§
Source§impl ImagePart
impl ImagePart
Sourcepub fn base64(media_type: impl Into<String>, data: impl Into<String>) -> Self
pub fn base64(media_type: impl Into<String>, data: impl Into<String>) -> Self
Creates an image part from base64 data.
Sourcepub fn file_ref(uri: impl Into<String>, media_type: Option<String>) -> Self
pub fn file_ref(uri: impl Into<String>, media_type: Option<String>) -> Self
Creates an image part referencing a file URI.
Sourcepub fn detail(self, detail: ImageDetail) -> Self
pub fn detail(self, detail: ImageDetail) -> Self
Sets the processing-detail hint.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImagePart
impl<'de> Deserialize<'de> for ImagePart
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 ImagePart
impl StructuralPartialEq for ImagePart
Auto Trait Implementations§
impl Freeze for ImagePart
impl RefUnwindSafe for ImagePart
impl Send for ImagePart
impl Sync for ImagePart
impl Unpin for ImagePart
impl UnsafeUnpin for ImagePart
impl UnwindSafe for ImagePart
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.