Skip to main content
Split text into chunks based on a specified separator, with control over chunk size and overlap between chunks. You use this function to:
  • Split text into chunks based on a specified separator
  • Control the chunk size and amount of overlap between chunks
  • Simple, predictable chunking strategy

Samples

Basic character splitting

Split content into 128-character chunks with 10-character overlap:

Custom separator

Split on newlines:

Regex separator

Split using a regular expression:

Arguments

Returns

A JSON configuration object for use in create_vectorizer().