MCPcopy
hub / github.com/openai/openai-python / upload_and_poll

Method upload_and_poll

src/openai/resources/vector_stores/files.py:416–433  ·  view source on GitHub ↗

Add a file to a vector store and poll until processing is complete.

(
        self,
        *,
        vector_store_id: str,
        file: FileTypes,
        attributes: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
        poll_interval_ms: int | Omit = omit,
        chunking_strategy: FileChunkingStrategyParam | Omit = omit,
    )

Source from the content-addressed store, hash-verified

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,
418 *,
419 vector_store_id: str,
420 file: FileTypes,
421 attributes: Optional[Dict[str, Union[str, float, bool]]] | Omit = omit,
422 poll_interval_ms: int | Omit = omit,
423 chunking_strategy: FileChunkingStrategyParam | Omit = omit,
424 ) -> VectorStoreFile:
425 """Add a file to a vector store and poll until processing is complete."""
426 file_obj = self._client.files.create(file=file, purpose="assistants")
427 return self.create_and_poll(
428 vector_store_id=vector_store_id,
429 file_id=file_obj.id,
430 chunking_strategy=chunking_strategy,
431 poll_interval_ms=poll_interval_ms,
432 attributes=attributes,
433 )
434
435 def content(
436 self,

Callers

nothing calls this directly

Calls 2

create_and_pollMethod · 0.95
createMethod · 0.45

Tested by

no test coverage detected