#[non_exhaustive]pub struct LayoutBasedChunkingConfig {
pub chunk_size: i32,
pub include_ancestor_headings: bool,
/* private fields */
}Available on crate feature
data-store-service only.Expand description
Configuration for the layout based chunking.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.chunk_size: i32The token size limit for each chunk.
Supported values: 100-500 (inclusive). Default value: 500.
include_ancestor_headings: boolWhether to include appending different levels of headings to chunks from the middle of the document to prevent context loss.
Default value: False.
Implementations§
Source§impl LayoutBasedChunkingConfig
impl LayoutBasedChunkingConfig
pub fn new() -> Self
Sourcepub fn set_chunk_size<T: Into<i32>>(self, v: T) -> Self
pub fn set_chunk_size<T: Into<i32>>(self, v: T) -> Self
Sets the value of chunk_size.
§Example
ⓘ
let x = LayoutBasedChunkingConfig::new().set_chunk_size(42);Sourcepub fn set_include_ancestor_headings<T: Into<bool>>(self, v: T) -> Self
pub fn set_include_ancestor_headings<T: Into<bool>>(self, v: T) -> Self
Sets the value of include_ancestor_headings.
§Example
ⓘ
let x = LayoutBasedChunkingConfig::new().set_include_ancestor_headings(true);Trait Implementations§
Source§impl Clone for LayoutBasedChunkingConfig
impl Clone for LayoutBasedChunkingConfig
Source§fn clone(&self) -> LayoutBasedChunkingConfig
fn clone(&self) -> LayoutBasedChunkingConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 LayoutBasedChunkingConfig
impl Debug for LayoutBasedChunkingConfig
Source§impl Default for LayoutBasedChunkingConfig
impl Default for LayoutBasedChunkingConfig
Source§fn default() -> LayoutBasedChunkingConfig
fn default() -> LayoutBasedChunkingConfig
Returns the “default value” for a type. Read more
Source§impl Message for LayoutBasedChunkingConfig
impl Message for LayoutBasedChunkingConfig
impl StructuralPartialEq for LayoutBasedChunkingConfig
Auto Trait Implementations§
impl Freeze for LayoutBasedChunkingConfig
impl RefUnwindSafe for LayoutBasedChunkingConfig
impl Send for LayoutBasedChunkingConfig
impl Sync for LayoutBasedChunkingConfig
impl Unpin for LayoutBasedChunkingConfig
impl UnwindSafe for LayoutBasedChunkingConfig
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