pub enum ContentBlock {
Text {
text: String,
},
ImageBase64 {
data: String,
media_type: String,
},
ImageUrl {
url: String,
detail: String,
},
VideoPath {
path: String,
fps: Option<f32>,
max_frames: Option<u32>,
},
VideoUrl {
url: String,
fps: Option<f32>,
max_frames: Option<u32>,
},
VideoBase64 {
data: String,
media_type: String,
fps: Option<f32>,
max_frames: Option<u32>,
},
AudioPath {
path: String,
sample_rate: Option<u32>,
},
AudioUrl {
url: String,
sample_rate: Option<u32>,
},
AudioBase64 {
data: String,
media_type: String,
sample_rate: Option<u32>,
},
}Expand description
A content block in a multimodal message.
The image variants (ImageBase64, ImageUrl) are fully wired on
the native Qwen2.5-VL backend. The video variants
(VideoPath, VideoUrl, VideoBase64) are defined on the public
request surface so higher-level tooling can express Qwen2.5-VL
video-understanding payloads, but the native backend returns
crate::InferenceError::UnsupportedMode for them until the
video-tokenization path lands. Remote multimodal providers
(Anthropic, Google Vertex) accept them through the protocol
handlers today.
Variants§
Text
Plain text content.
ImageBase64
Base64-encoded image.
Fields
ImageUrl
Image from URL.
Fields
VideoPath
Video loaded from a local filesystem path. Qwen2.5-VL samples
the clip at fps frames/sec (default: backend-chosen) and
caps at max_frames to respect context budgets.
VideoUrl
Video accessible over HTTP(S). Semantics as ContentBlock::VideoPath.
VideoBase64
Base64-encoded video bytes. Prefer VideoPath when possible;
inline base64 is expensive to round-trip.
AudioPath
Audio loaded from a local filesystem path. Used for audio-understanding models (Gemma 4 small variants, Gemini).
Fields
AudioUrl
Audio accessible over HTTP(S).
AudioBase64
Base64-encoded audio bytes.
Implementations§
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§fn clone(&self) -> ContentBlock
fn clone(&self) -> ContentBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContentBlock
impl Debug for ContentBlock
Source§impl<'de> Deserialize<'de> for ContentBlock
impl<'de> Deserialize<'de> for ContentBlock
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>,
Auto Trait Implementations§
impl Freeze for ContentBlock
impl RefUnwindSafe for ContentBlock
impl Send for ContentBlock
impl Sync for ContentBlock
impl Unpin for ContentBlock
impl UnsafeUnpin for ContentBlock
impl UnwindSafe for ContentBlock
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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