Skip to content

Commit

Permalink
fix(jsonl): lower chunk size (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Feb 7, 2025
1 parent 75fd4c0 commit 6a402ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/anthropic/_legacy_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
return cast(
R,
cast("type[JSONLDecoder[Any]]", cast_to)(
raw_iterator=self.http_response.iter_bytes(chunk_size=4096),
raw_iterator=self.http_response.iter_bytes(chunk_size=64),
line_type=extract_type_arg(cast_to, 0),
http_response=self.http_response,
),
Expand All @@ -220,7 +220,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
return cast(
R,
cast("type[AsyncJSONLDecoder[Any]]", cast_to)(
raw_iterator=self.http_response.aiter_bytes(chunk_size=4096),
raw_iterator=self.http_response.aiter_bytes(chunk_size=64),
line_type=extract_type_arg(cast_to, 0),
http_response=self.http_response,
),
Expand Down
4 changes: 2 additions & 2 deletions src/anthropic/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
return cast(
R,
cast("type[JSONLDecoder[Any]]", cast_to)(
raw_iterator=self.http_response.iter_bytes(chunk_size=4096),
raw_iterator=self.http_response.iter_bytes(chunk_size=64),
line_type=extract_type_arg(cast_to, 0),
http_response=self.http_response,
),
Expand All @@ -154,7 +154,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
return cast(
R,
cast("type[AsyncJSONLDecoder[Any]]", cast_to)(
raw_iterator=self.http_response.aiter_bytes(chunk_size=4096),
raw_iterator=self.http_response.aiter_bytes(chunk_size=64),
line_type=extract_type_arg(cast_to, 0),
http_response=self.http_response,
),
Expand Down

0 comments on commit 6a402ae

Please sign in to comment.