pub trait TextSplitter: Send + Sync {
// Required method
fn split_text(&self, text: &str) -> Vec<String>;
// Provided method
fn split_documents(&self, docs: Vec<Document>) -> Vec<Document> { ... }
}Expand description
Trait for splitting text into chunks.
Required Methods§
Sourcefn split_text(&self, text: &str) -> Vec<String>
fn split_text(&self, text: &str) -> Vec<String>
Split a string into chunks.