diff --git a/.stats.yml b/.stats.yml index 49956282b..50c6b293d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 64 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-edb5af3ade0cd27cf366b0654b90c7a81c43c433e11fc3f6e621e2c779de10d4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-2e14236d4015bf3b956290ea8b656224a0c7b206a356c6af2a7ae43fdbceb04c.yml diff --git a/src/openai/resources/files.py b/src/openai/resources/files.py index fa03a9c0e..086745b47 100644 --- a/src/openai/resources/files.py +++ b/src/openai/resources/files.py @@ -52,7 +52,7 @@ def create( self, *, file: FileTypes, - purpose: Literal["fine-tune", "assistants"], + purpose: Literal["assistants", "batch", "fine-tune"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -79,12 +79,11 @@ def create( purpose: The intended purpose of the uploaded file. - Use "fine-tune" for - [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and - "assistants" for + Use "assistants" for [Assistants](https://platform.openai.com/docs/api-reference/assistants) and - [Messages](https://platform.openai.com/docs/api-reference/messages). This allows - us to validate the format of the uploaded file is correct for fine-tuning. + [Messages](https://platform.openai.com/docs/api-reference/messages), "batch" for + [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for + [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). extra_headers: Send extra headers @@ -325,7 +324,7 @@ async def create( self, *, file: FileTypes, - purpose: Literal["fine-tune", "assistants"], + purpose: Literal["assistants", "batch", "fine-tune"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,12 +351,11 @@ async def create( purpose: The intended purpose of the uploaded file. - Use "fine-tune" for - [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and - "assistants" for + Use "assistants" for [Assistants](https://platform.openai.com/docs/api-reference/assistants) and - [Messages](https://platform.openai.com/docs/api-reference/messages). This allows - us to validate the format of the uploaded file is correct for fine-tuning. + [Messages](https://platform.openai.com/docs/api-reference/messages), "batch" for + [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for + [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). extra_headers: Send extra headers diff --git a/src/openai/types/file_create_params.py b/src/openai/types/file_create_params.py index 26e2da337..3867fcb06 100644 --- a/src/openai/types/file_create_params.py +++ b/src/openai/types/file_create_params.py @@ -13,13 +13,12 @@ class FileCreateParams(TypedDict, total=False): file: Required[FileTypes] """The File object (not file name) to be uploaded.""" - purpose: Required[Literal["fine-tune", "assistants"]] + purpose: Required[Literal["assistants", "batch", "fine-tune"]] """The intended purpose of the uploaded file. - Use "fine-tune" for - [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and - "assistants" for + Use "assistants" for [Assistants](https://platform.openai.com/docs/api-reference/assistants) and - [Messages](https://platform.openai.com/docs/api-reference/messages). This allows - us to validate the format of the uploaded file is correct for fine-tuning. + [Messages](https://platform.openai.com/docs/api-reference/messages), "batch" for + [Batch API](https://platform.openai.com/docs/guides/batch), and "fine-tune" for + [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). """ diff --git a/src/openai/types/file_object.py b/src/openai/types/file_object.py index 589a1faf3..d24a5b1a8 100644 --- a/src/openai/types/file_object.py +++ b/src/openai/types/file_object.py @@ -24,11 +24,11 @@ class FileObject(BaseModel): object: Literal["file"] """The object type, which is always `file`.""" - purpose: Literal["fine-tune", "fine-tune-results", "assistants", "assistants_output"] + purpose: Literal["assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results"] """The intended purpose of the file. - Supported values are `fine-tune`, `fine-tune-results`, `assistants`, and - `assistants_output`. + Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, + `fine-tune`, and `fine-tune-results`. """ status: Literal["uploaded", "processed", "error"] diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index e5466e9ed..882f0ddbe 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -27,7 +27,7 @@ class TestFiles: def test_method_create(self, client: OpenAI) -> None: file = client.files.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) assert_matches_type(FileObject, file, path=["response"]) @@ -35,7 +35,7 @@ def test_method_create(self, client: OpenAI) -> None: def test_raw_response_create(self, client: OpenAI) -> None: response = client.files.with_raw_response.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) assert response.is_closed is True @@ -47,7 +47,7 @@ def test_raw_response_create(self, client: OpenAI) -> None: def test_streaming_response_create(self, client: OpenAI) -> None: with client.files.with_streaming_response.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -263,7 +263,7 @@ class TestAsyncFiles: async def test_method_create(self, async_client: AsyncOpenAI) -> None: file = await async_client.files.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) assert_matches_type(FileObject, file, path=["response"]) @@ -271,7 +271,7 @@ async def test_method_create(self, async_client: AsyncOpenAI) -> None: async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: response = await async_client.files.with_raw_response.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) assert response.is_closed is True @@ -283,7 +283,7 @@ async def test_raw_response_create(self, async_client: AsyncOpenAI) -> None: async def test_streaming_response_create(self, async_client: AsyncOpenAI) -> None: async with async_client.files.with_streaming_response.create( file=b"raw file contents", - purpose="fine-tune", + purpose="assistants", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"