`rabbithole_instantiates_splitter`
Hook the splitter used to split text in chunks.
Allows replacing the default text splitter to customize the splitting process.
📄 Arguments
Section titled “📄 Arguments”| Name | Type | Description |
|---|---|---|
text_splitter |
TextSplitter |
The text splitter used by default, currently is the Langchain’s TextSplitter. |
cat |
Cat | Cheshire Cat instance, allows you to use the framework components. |
↩️ Return
Section titled “↩️ Return”Type: TextSplitter
An instance of a TextSplitter subclass.
✍ Example
Section titled “✍ Example”from cat.mad_hatter.decorators import hook
@hook # default priority = 1def rabbithole_instantiates_splitter(text_splitter, cat): text_splitter._chunk_size = 64 text_splitter._chunk_overlap = 8 return text_splitter