Skip to content

TokenTextSplitter

PropertyPatternTypeDeprecatedDefinitionTitle/Description
+ implementationNoconstNo-Implementation
- chunk_sizeNointegerNo-Chunk Size
- chunk_overlapNointegerNo-Chunk Overlap
- keep_separatorNobooleanNo-Keep Separator
- strip_whitespaceNobooleanNo-Strip Whitespace
- encoding_nameNostringNo-Encoding Name
- modelNostringNo-Model
- allowed_specialNoCombinationNo-Allowed Special
- disallowed_specialNoCombinationNo-Disallowed Special

1. Property implementation

Title: Implementation

Typeconst
RequiredYes

Specific value: "TokenTextSplitter"

2. Property chunk_size

Title: Chunk Size

Typeinteger
RequiredNo
Default4000

Description: Maximum size of chunks to return

3. Property chunk_overlap

Title: Chunk Overlap

Typeinteger
RequiredNo
Default200

Description: Overlap in characters between chunks

4. Property keep_separator

Title: Keep Separator

Typeboolean
RequiredNo
Defaultfalse

Description: Whether to keep the separator in the chunks

5. Property strip_whitespace

Title: Strip Whitespace

Typeboolean
RequiredNo
Defaulttrue

Description: If True, strips whitespace from the start and end of every document

6. Property encoding_name

Title: Encoding Name

Typestring
RequiredNo
Default"gpt2"

Description: Encoding name

7. Property model

Title: Model

Typestring
RequiredNo
Defaultnull

Description: Model name

8. Property allowed_special

Title: Allowed Special

Typecombining
RequiredNo
Additional properties[Any type: allowed]
Default[]

Description: Allowed special tokens

Any of(Option)
item 0
item 1

8.1. Property item 0

Typeconst
RequiredNo

Must be one of:

  • “all” Specific value: "all"

8.2. Property item 1

Typearray of string
RequiredNo
Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
item 1 items-

8.2.1. item 1 items

Typestring
RequiredNo

9. Property disallowed_special

Title: Disallowed Special

Typecombining
RequiredNo
Additional properties[Any type: allowed]
Default"all"

Description: Disallowed special tokens

Any of(Option)
item 0
item 1

9.1. Property item 0

Typeconst
RequiredNo

Must be one of:

  • “all” Specific value: "all"

9.2. Property item 1

Typearray of string
RequiredNo
Array restrictions
Min itemsN/A
Max itemsN/A
Items unicityFalse
Additional itemsFalse
Tuple validationSee below
Each item of this array must beDescription
item 1 items-

9.2.1. item 1 items

Typestring
RequiredNo