rabbithole_instantiates_splitter
Hook the splitter used to split text in chunks.
Allows replacing the default text splitter to customize the splitting process.
đ Arguments
Name | Type | Description |
---|---|---|
text_splitter |
TextSplitter |
The text splitter used by default, currently is the Langchain's TextSplitter . |
cat |
StrayCat | Cheshire Cat instance, allows you to use the framework components. |
âŠī¸ Return
Type: TextSplitter
An instance of a TextSplitter subclass.
â Example
from cat.mad_hatter.decorators import hook
@hook # default priority = 1
def rabbithole_instantiates_splitter(text_splitter, cat):
text_splitter._chunk_size = 64
text_splitter._chunk_overlap = 8
return text_splitter
Note