pub struct VlmPrompt<'a> {
pub parts: Vec<VlmPart<'a>>,
}Expand description
An ordered, interleaved multimodal prompt — text <img> text <img> text.
Order is the payload. “Compare the first image to the second” is not expressible as a set of images plus a question, and a model that receives the images in the wrong order answers the wrong question fluently. So the prompt is a sequence and the engine splices its image-token blocks at the positions the sequence gives it.
Fields§
§parts: Vec<VlmPart<'a>>Implementations§
Source§impl<'a> VlmPrompt<'a>
impl<'a> VlmPrompt<'a>
Sourcepub fn single(image: &'a ImageBuffer, text: Option<&'a str>) -> Self
pub fn single(image: &'a ImageBuffer, text: Option<&'a str>) -> Self
The single-image case: the image, then the instruction if there is one.
Sourcepub fn image_count(&self) -> usize
pub fn image_count(&self) -> usize
Number of images in the prompt — what an engine checks against the image-token placeholders it is about to splice.
Trait Implementations§
impl<'a> Eq for VlmPrompt<'a>
impl<'a> StructuralPartialEq for VlmPrompt<'a>
Auto Trait Implementations§
impl<'a> Freeze for VlmPrompt<'a>
impl<'a> RefUnwindSafe for VlmPrompt<'a>
impl<'a> Send for VlmPrompt<'a>
impl<'a> Sync for VlmPrompt<'a>
impl<'a> Unpin for VlmPrompt<'a>
impl<'a> UnsafeUnpin for VlmPrompt<'a>
impl<'a> UnwindSafe for VlmPrompt<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more