pub struct FileContent {
pub url: String,
pub mime_type: Option<String>,
pub name: Option<String>,
}Expand description
File content (URL or base64 data URI).
Used for document/file input in multimodal interactions, such as PDF processing or document analysis.
Fields§
§url: StringURL or data URI for the file.
mime_type: Option<String>MIME type of the file (e.g., “application/pdf”, “text/csv”).
name: Option<String>Optional filename for reference.
Implementations§
Source§impl FileContent
impl FileContent
Sourcepub fn from_base64(data: impl Into<String>, mime: &str) -> Self
pub fn from_base64(data: impl Into<String>, mime: &str) -> Self
Creates from base64 data with an explicit MIME type.
Sourcepub fn from_url_with_mime(
url: impl Into<String>,
mime: impl Into<String>,
) -> Self
pub fn from_url_with_mime( url: impl Into<String>, mime: impl Into<String>, ) -> Self
Creates from a URL with a known MIME type.
Sourcepub fn base64_data(&self) -> Option<&str>
pub fn base64_data(&self) -> Option<&str>
Extracts the base64 raw data (if this is a data URI).
Trait Implementations§
Source§impl Clone for FileContent
impl Clone for FileContent
Source§fn clone(&self) -> FileContent
fn clone(&self) -> FileContent
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 FileContent
impl Debug for FileContent
Source§impl<'de> Deserialize<'de> for FileContent
impl<'de> Deserialize<'de> for FileContent
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
Source§impl PartialEq for FileContent
impl PartialEq for FileContent
Source§impl Serialize for FileContent
impl Serialize for FileContent
impl StructuralPartialEq for FileContent
Auto Trait Implementations§
impl Freeze for FileContent
impl RefUnwindSafe for FileContent
impl Send for FileContent
impl Sync for FileContent
impl Unpin for FileContent
impl UnsafeUnpin for FileContent
impl UnwindSafe for FileContent
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