Chunking Strategy with Vector Stores in API v2

The docs say that we can use the chunking_strategy parameter when creating vector stores. However, I am unable to get it to work and get an “unexpected keyword argument” error. Is this a known issue?

Here is my code:

vector_store = client.beta.vector_stores.create(
    chunking_strategy={
        "type": "auto"
    }
)
print(vector_store)

The parameter was only committed to libraries and documentation yesterday.

You will have to update the python library in order for it to validate new things.

Or rewrite your API calls with another http library so you never again have some gatekeeper software preventing you from sending what you want.

sending auto will do nothing differently.

There is only one type, the same as auto, except that it has token counts to modify on new vector store documents.
{

“chunking_strategy”: {
“type”: “static”,
“static”: {
“max_chunk_size_tokens”: 800,
“chunk_overlap_tokens”: 400
}
}
}

Accompanying this is not a threshold or a token limit, but a number of chunks returned from any search no matter how irrelevant. So you can choose 10 or 30 chunks of duck hunting regulations filling the context when you are programming in Rust to better customize your experience.

1 Like

Epic response and exactly what I needed thanks @_j :+1: