Upload a file to the `files` API and then attach it to the given vector store. Note the file will be asynchronously processed (you can use the alternative polling helper method to wait for processing to complete).
(
self,
*,
vector_store_id: str,
file: FileTypes,
chunking_strategy: FileChunkingStrategyParam | Omit = omit,
)
| 399 | return file |
| 400 | |
| 401 | def upload( |
| 402 | self, |
| 403 | *, |
| 404 | vector_store_id: str, |
| 405 | file: FileTypes, |
| 406 | chunking_strategy: FileChunkingStrategyParam | Omit = omit, |
| 407 | ) -> VectorStoreFile: |
| 408 | """Upload a file to the `files` API and then attach it to the given vector store. |
| 409 | |
| 410 | Note the file will be asynchronously processed (you can use the alternative |
| 411 | polling helper method to wait for processing to complete). |
| 412 | """ |
| 413 | file_obj = self._client.files.create(file=file, purpose="assistants") |
| 414 | return self.create(vector_store_id=vector_store_id, file_id=file_obj.id, chunking_strategy=chunking_strategy) |
| 415 | |
| 416 | def upload_and_poll( |
| 417 | self, |