pub struct MultimodalChunker { /* private fields */ }Expand description
Turns ordered MediaBlocks into modality-tagged Documents.
Implementations§
Source§impl MultimodalChunker
impl MultimodalChunker
Sourcepub fn with_config(config: MultimodalChunkConfig) -> Self
pub fn with_config(config: MultimodalChunkConfig) -> Self
Creates a chunker with explicit config.
Sourcepub fn chunk(&self, blocks: &[MediaBlock]) -> Vec<Document>
pub fn chunk(&self, blocks: &[MediaBlock]) -> Vec<Document>
Chunks the blocks into Documents, preserving input order.
- Empty/whitespace text blocks are skipped;
- text blocks are optionally split into UTF-8-safe windows;
- images always become one document each; an image without a caption
still embeds (its content is empty), but
RetrieverErroris never raised at chunk time — validation happens at embedding time.
Sourcepub fn text_document(&self, content: impl Into<String>) -> Document
pub fn text_document(&self, content: impl Into<String>) -> Document
Builds a tagged text document directly.
Sourcepub fn image_document(&self, asset: &ImageAsset) -> Document
pub fn image_document(&self, asset: &ImageAsset) -> Document
Builds a tagged image document directly.
Trait Implementations§
Source§impl Clone for MultimodalChunker
impl Clone for MultimodalChunker
Source§fn clone(&self) -> MultimodalChunker
fn clone(&self) -> MultimodalChunker
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 MultimodalChunker
impl Debug for MultimodalChunker
Source§impl Default for MultimodalChunker
impl Default for MultimodalChunker
Source§fn default() -> MultimodalChunker
fn default() -> MultimodalChunker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MultimodalChunker
impl RefUnwindSafe for MultimodalChunker
impl Send for MultimodalChunker
impl Sync for MultimodalChunker
impl Unpin for MultimodalChunker
impl UnsafeUnpin for MultimodalChunker
impl UnwindSafe for MultimodalChunker
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