pub enum Image {
Base64 {
media_type: String,
data: String,
},
Url {
url: String,
},
}Expand description
An image the model should look at. Carried on user messages and on tool
results; providers map it to their own wire format and ignore it on other
roles. Debug omits the encoded bytes so transcripts stay loggable.
Variants§
Base64
Inline bytes, base64-encoded (standard alphabet, with padding).
Url
A URL the provider fetches itself.
Implementations§
Source§impl Image
impl Image
pub fn base64(media_type: impl Into<String>, data: impl Into<String>) -> Self
pub fn url(url: impl Into<String>) -> Self
Sourcepub fn from_url_or_data(url: &str) -> Self
pub fn from_url_or_data(url: &str) -> Self
An image from a URL: a data:<type>;base64, URL becomes inline
bytes (providers that take no URLs can then still send it), anything
else stays a URL.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Image
impl<'de> Deserialize<'de> for Image
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 Image
impl StructuralPartialEq for Image
Auto Trait Implementations§
impl Forget for Image
impl Freeze for Image
impl Move for Image
impl RefUnwindSafe for Image
impl Send for Imagewhere
RawVecInner: Send,
impl Sync for Imagewhere
RawVecInner: Sync,
impl Unpin for Image
impl UnsafeUnpin for Image
impl UnwindSafe for Imagewhere
RawVecInner: UnwindSafe,
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