Skip to content

Commit 4812122

Browse files
RobertCraigiestainless-app[bot]
authored andcommitted
fix(vector stores): add missing arguments to files.upload_and_poll
1 parent 77d5ac2 commit 4812122

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/openai/resources/vector_stores/files.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ def upload_and_poll(
380380
*,
381381
vector_store_id: str,
382382
file: FileTypes,
383+
attributes: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
383384
poll_interval_ms: int | NotGiven = NOT_GIVEN,
384385
chunking_strategy: FileChunkingStrategyParam | NotGiven = NOT_GIVEN,
385386
) -> VectorStoreFile:
@@ -390,6 +391,7 @@ def upload_and_poll(
390391
file_id=file_obj.id,
391392
chunking_strategy=chunking_strategy,
392393
poll_interval_ms=poll_interval_ms,
394+
attributes=attributes,
393395
)
394396

395397
def content(
@@ -788,6 +790,7 @@ async def upload_and_poll(
788790
*,
789791
vector_store_id: str,
790792
file: FileTypes,
793+
attributes: Optional[Dict[str, Union[str, float, bool]]] | NotGiven = NOT_GIVEN,
791794
poll_interval_ms: int | NotGiven = NOT_GIVEN,
792795
chunking_strategy: FileChunkingStrategyParam | NotGiven = NOT_GIVEN,
793796
) -> VectorStoreFile:
@@ -798,6 +801,7 @@ async def upload_and_poll(
798801
file_id=file_obj.id,
799802
poll_interval_ms=poll_interval_ms,
800803
chunking_strategy=chunking_strategy,
804+
attributes=attributes,
801805
)
802806

803807
def content(

tests/api_resources/vector_stores/test_files.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,3 +637,14 @@ def test_create_and_poll_method_in_sync(sync: bool, client: OpenAI, async_client
637637
checking_client.vector_stores.files.create_and_poll,
638638
exclude_params={"extra_headers", "extra_query", "extra_body", "timeout"},
639639
)
640+
641+
642+
@pytest.mark.parametrize("sync", [True, False], ids=["sync", "async"])
643+
def test_upload_and_poll_method_in_sync(sync: bool, client: OpenAI, async_client: AsyncOpenAI) -> None:
644+
checking_client: OpenAI | AsyncOpenAI = client if sync else async_client
645+
646+
assert_signatures_in_sync(
647+
checking_client.vector_stores.files.create,
648+
checking_client.vector_stores.files.upload_and_poll,
649+
exclude_params={"file_id", "extra_headers", "extra_query", "extra_body", "timeout"},
650+
)

0 commit comments

Comments
 (0)