GoodMemGoodMem
ReferenceSdkRustTypes

RecursiveChunkingConfiguration

Rust struct goodmem::models::RecursiveChunkingConfiguration: declaration, fields or variants, and implementations.

All types

Struct RecursiveChunkingConfiguration

goodmem::models::RecursiveChunkingConfiguration

Recursive hierarchical chunking strategy with configurable separators and overlap

pub struct RecursiveChunkingConfiguration {
    pub chunk_size: i32,
    pub chunk_overlap: i32,
    pub separators: Option<Vec<String>>,
    pub keep_strategy: SeparatorKeepStrategy,
    pub separator_is_regex: Option<bool>,
    pub length_measurement: LengthMeasurement,
}

Referenced types: LengthMeasurement, SeparatorKeepStrategy.

Fields

chunk_size

pub chunk_size: i32

Maximum size of a chunk (should be ≤ context window) Wire name: chunkSize.

chunk_overlap

pub chunk_overlap: i32

Sliding overlap between chunks Wire name: chunkOverlap.

separators

pub separators: Option<Vec<String>>

Hierarchical separator list (order = preference) Wire name: separators.

keep_strategy

pub keep_strategy: SeparatorKeepStrategy

How to handle separators after splitting. KEEP_NONE is deprecated and behaves as KEEP_END. Wire name: keepStrategy.

separator_is_regex

pub separator_is_regex: Option<bool>

Whether separators are regex patterns Wire name: separatorIsRegex.

length_measurement

pub length_measurement: LengthMeasurement

How to measure chunk length Wire name: lengthMeasurement.

Implementations

validate

pub fn validate(&self) -> crate::Result<()>

Validate the request before sending, without making an HTTP call.

Trait implementations

  • Clone (derived)
  • Default (derived)
  • PartialEq (derived)
  • Serialize (derived)
  • impl<'de> Deserialize<'de> for RecursiveChunkingConfiguration
  • impl std::fmt::Debug for RecursiveChunkingConfiguration

On this page