Skip to content

chunking_strategy at vector store level is not being applied to files. #2380

Open
@rakeshsilswal

Description

@rakeshsilswal

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

I have created vector store with

new_store = await self.client.vector_stores.create( name=name, expires_after={"anchor": "last_active_at", "days": expires_days}, chunking_strategy={ "type": "static", "static": { "max_chunk_size_tokens": max_chunk_size_tokens, "chunk_overlap_tokens": chunk_overlap_tokens } } )

when i am uploading files with upload_and_poll, and retrieving file attribute, i am getting (with default chunk size).

VectorStoreFile(id='assistant-MX3yjwZooLxymkJMWE217V', created_at=1748104237, last_error=None, object='vector_store.file', status='completed', usage_bytes=65486, vector_store_id='vs_ajzhAjwMLVQoqYGfAFC4T5LX', attributes=None, chunking_strategy=StaticFileChunkingStrategyObject(static=StaticFileChunkingStrategy(chunk_overlap_tokens=400, max_chunk_size_tokens=800), type='static'))

and when i am passing chunking_strategy to upload_and_poll. it is getting applied correctly.

To Reproduce

  1. create vector store with chunking_strategy
  2. upload file using upload_and_poll. do not pass chunking_strategy
  3. retrieve file propertied using "client.vector_stores.files.retrieve"
  4. you will observe static=StaticFileChunkingStrategy(chunk_overlap_tokens=400, max_chunk_size_tokens=800)

Code snippets

OS

windows

Python version

3.11.11

Library version

openai v1.82.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions