Skip to main content
Subclass ChunkingStrategy and implement chunk() to return a list of Document objects.
1

Create a Python file

custom_chunking.py
2

Set up your virtual environment

3

Install dependencies

4

Export your OpenAI API key

Set OpenAI Key

Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.
5

Run PgVector

6

Run the script

Custom Chunking Params

Developer Resources