pub struct StaticChunkingStrategy {
pub max_chunk_size_tokens: u64,
pub chunk_overlap_tokens: u64,
}
Fields§
§max_chunk_size_tokens: u64
The maximum number of tokens in each chunk. The default value is 800
. The minimum value is 100
and the maximum value is 4096
.
chunk_overlap_tokens: u64
The number of tokens that overlap between chunks. The default value is 400
.
Note that the overlap must not exceed half of max_chunk_size_tokens
.
Implementations§
Source§impl StaticChunkingStrategy
impl StaticChunkingStrategy
Sourcepub fn builder() -> StaticChunkingStrategyBuilder<((), ())>
pub fn builder() -> StaticChunkingStrategyBuilder<((), ())>
Create a builder for building StaticChunkingStrategy
.
On the builder, call .max_chunk_size_tokens(...)
, .chunk_overlap_tokens(...)
to set the values of the fields.
Finally, call .build()
to create the instance of StaticChunkingStrategy
.
Trait Implementations§
Source§impl Clone for StaticChunkingStrategy
impl Clone for StaticChunkingStrategy
Source§fn clone(&self) -> StaticChunkingStrategy
fn clone(&self) -> StaticChunkingStrategy
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 StaticChunkingStrategy
impl Debug for StaticChunkingStrategy
Source§impl<'de> Deserialize<'de> for StaticChunkingStrategy
impl<'de> Deserialize<'de> for StaticChunkingStrategy
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StaticChunkingStrategy
impl PartialEq for StaticChunkingStrategy
Source§impl Serialize for StaticChunkingStrategy
impl Serialize for StaticChunkingStrategy
impl Copy for StaticChunkingStrategy
impl StructuralPartialEq for StaticChunkingStrategy
Auto Trait Implementations§
impl Freeze for StaticChunkingStrategy
impl RefUnwindSafe for StaticChunkingStrategy
impl Send for StaticChunkingStrategy
impl Sync for StaticChunkingStrategy
impl Unpin for StaticChunkingStrategy
impl UnwindSafe for StaticChunkingStrategy
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