diff --git a/src/writerai/resources/files.py b/src/writerai/resources/files.py index 83f5550..00f7824 100644 --- a/src/writerai/resources/files.py +++ b/src/writerai/resources/files.py @@ -6,12 +6,9 @@ import httpx -from ..types import file_list_params, file_upload_params +from ..types import file_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes -from .._utils import ( - maybe_transform, - async_maybe_transform, -) +from .._utils import maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -199,7 +196,6 @@ def upload( *, content: FileTypes, content_disposition: str, - content_length: int, 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. @@ -222,7 +218,6 @@ def upload( """ extra_headers = { "Content-Disposition": content_disposition, - "Content-Length": str(content_length), "Content-Type": content_type, **(extra_headers or {}), } @@ -399,7 +394,6 @@ async def upload( *, content: FileTypes, content_disposition: str, - content_length: int, 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. @@ -422,7 +416,6 @@ async def upload( """ extra_headers = { "Content-Disposition": content_disposition, - "Content-Length": str(content_length), "Content-Type": content_type, **(extra_headers or {}), } diff --git a/tests/api_resources/test_files.py b/tests/api_resources/test_files.py index aaa93d8..5cccdf8 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_length=0, content_type="Content-Type", ) assert_matches_type(File, file, path=["response"]) @@ -209,7 +208,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_length=0, content_type="Content-Type", ) @@ -224,7 +222,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_length=0, content_type="Content-Type", ) as response: assert not response.is_closed @@ -411,7 +408,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_length=0, content_type="Content-Type", ) assert_matches_type(File, file, path=["response"]) @@ -422,7 +418,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_length=0, content_type="Content-Type", ) @@ -437,7 +432,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_length=0, content_type="Content-Type", ) as response: assert not response.is_closed