diff --git a/src/writerai/resources/files.py b/src/writerai/resources/files.py index 336ce0a..6af9b5b 100644 --- a/src/writerai/resources/files.py +++ b/src/writerai/resources/files.py @@ -211,7 +211,6 @@ def upload( *, content: FileTypes, content_disposition: str, - content_type: str, # 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, @@ -231,11 +230,7 @@ def upload( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - "Content-Disposition": content_disposition, - "Content-Type": content_type, - **(extra_headers or {}), - } + extra_headers = {"Content-Disposition": content_disposition, **(extra_headers or {})} return self._post( "/v1/files", options=make_request_options( @@ -424,7 +419,6 @@ async def upload( *, content: FileTypes, content_disposition: str, - content_type: str, # 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, @@ -444,11 +438,7 @@ async def upload( timeout: Override the client-level default timeout for this request, in seconds """ - extra_headers = { - "Content-Disposition": content_disposition, - "Content-Type": content_type, - **(extra_headers or {}), - } + extra_headers = {"Content-Disposition": content_disposition, **(extra_headers or {})} return await self._post( "/v1/files", options=make_request_options( diff --git a/src/writerai/types/file_upload_params.py b/src/writerai/types/file_upload_params.py index 14077b9..760021f 100644 --- a/src/writerai/types/file_upload_params.py +++ b/src/writerai/types/file_upload_params.py @@ -14,5 +14,3 @@ class FileUploadParams(TypedDict, total=False): content: Required[FileTypes] content_disposition: Required[Annotated[str, PropertyInfo(alias="Content-Disposition")]] - - content_type: Required[Annotated[str, PropertyInfo(alias="Content-Type")]] diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index 6e02268..85041dc 100644 --- a/tests/api_resources/test_files.py +++ b/tests/api_resources/test_files.py @@ -198,7 +198,6 @@ def test_method_upload(self, client: Writer) -> None: file = client.files.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) assert_matches_type(File, file, path=["response"]) @@ -208,7 +207,6 @@ def test_raw_response_upload(self, client: Writer) -> None: response = client.files.with_raw_response.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) assert response.is_closed is True @@ -222,7 +220,6 @@ def test_streaming_response_upload(self, client: Writer) -> None: with client.files.with_streaming_response.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -408,7 +405,6 @@ async def test_method_upload(self, async_client: AsyncWriter) -> None: file = await async_client.files.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) assert_matches_type(File, file, path=["response"]) @@ -418,7 +414,6 @@ async def test_raw_response_upload(self, async_client: AsyncWriter) -> None: response = await async_client.files.with_raw_response.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) assert response.is_closed is True @@ -432,7 +427,6 @@ async def test_streaming_response_upload(self, async_client: AsyncWriter) -> Non async with async_client.files.with_streaming_response.upload( content=b"raw file contents", content_disposition="Content-Disposition", - content_type="Content-Type", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"