pub struct ChatAttachment {
pub kind: AttachmentKind,
pub data: Vec<u8>,
pub mime_type: String,
pub name: Option<String>,
}Expand description
A file attached to a chat message: an image forwarded to a vision model, or a document inlined into the prompt text.
Fields§
§kind: AttachmentKindWhether this is an image or a document.
data: Vec<u8>The raw bytes.
mime_type: StringThe MIME type.
name: Option<String>An optional file name.
Implementations§
Source§impl ChatAttachment
impl ChatAttachment
Sourcepub fn inline_block(&self) -> Option<String>
pub fn inline_block(&self) -> Option<String>
The prompt-inlined block for a document attachment (wrapping its UTF-8
text in an <attached-file> element), or None for an image.
Trait Implementations§
Source§impl Clone for ChatAttachment
impl Clone for ChatAttachment
Source§impl Debug for ChatAttachment
impl Debug for ChatAttachment
Source§impl PartialEq for ChatAttachment
impl PartialEq for ChatAttachment
impl StructuralPartialEq for ChatAttachment
Auto Trait Implementations§
impl Freeze for ChatAttachment
impl RefUnwindSafe for ChatAttachment
impl Send for ChatAttachment
impl Sync for ChatAttachment
impl Unpin for ChatAttachment
impl UnsafeUnpin for ChatAttachment
impl UnwindSafe for ChatAttachment
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