Struct langchain_rust::text_splitter::SplitterOptions
source · pub struct SplitterOptions {
pub chunk_size: i32,
pub chunk_overlap: i32,
pub separators: Vec<String>,
pub len_func: Option<Box<dyn Fn(&str) -> usize>>,
pub model_name: String,
pub encoding_name: String,
pub allowed_special: Vec<String>,
pub disallowed_special: Vec<String>,
pub code_blocks: bool,
pub reference_links: bool,
}
Fields§
§chunk_size: i32
§chunk_overlap: i32
§separators: Vec<String>
§len_func: Option<Box<dyn Fn(&str) -> usize>>
§model_name: String
§encoding_name: String
§allowed_special: Vec<String>
§disallowed_special: Vec<String>
§code_blocks: bool
§reference_links: bool
Implementations§
source§impl SplitterOptions
impl SplitterOptions
pub fn with_chunk_size(self, chunk_size: i32) -> Self
pub fn with_chunk_overlap(self, chunk_overlap: i32) -> Self
pub fn with_separators(self, separators: Vec<&str>) -> Self
pub fn with_len_func(self, len_func: Box<dyn Fn(&str) -> usize>) -> Self
pub fn with_model_name(self, model_name: &str) -> Self
pub fn with_encoding_name(self, encoding_name: &str) -> Self
pub fn with_allowed_special(self, allowed_special: Vec<&str>) -> Self
pub fn with_disallowed_special(self, disallowed_special: Vec<&str>) -> Self
pub fn with_code_blocks(self, code_blocks: bool) -> Self
pub fn with_reference_links(self, reference_links: bool) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SplitterOptions
impl !Send for SplitterOptions
impl !Sync for SplitterOptions
impl Unpin for SplitterOptions
impl !UnwindSafe for SplitterOptions
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