pub struct MtmdTurn {
pub role: String,
pub text: String,
pub images: Vec<MediaSource>,
pub audio: Vec<MediaSource>,
}Expand description
One turn in a multimodal conversation. text is rendered through
the same ChatTemplate as the text-only path; images / audio
are interleaved into the LM stream by the per-family runner.
Fields§
§role: String§text: String§images: Vec<MediaSource>§audio: Vec<MediaSource>Implementations§
Source§impl MtmdTurn
impl MtmdTurn
pub fn user(text: impl Into<String>) -> Self
pub fn system(text: impl Into<String>) -> Self
pub fn assistant(text: impl Into<String>) -> Self
pub fn with_image_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_image_bytes(self, bytes: Vec<u8>) -> Self
pub fn with_audio_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_audio_bytes(self, bytes: Vec<u8>) -> Self
pub fn has_media(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MtmdTurn
impl RefUnwindSafe for MtmdTurn
impl Send for MtmdTurn
impl Sync for MtmdTurn
impl Unpin for MtmdTurn
impl UnsafeUnpin for MtmdTurn
impl UnwindSafe for MtmdTurn
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<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