Skip to content

Conversation

@stainless-app
Copy link
Contributor

@stainless-app stainless-app bot commented Jan 14, 2026

Automated Release PR

1.20.0 (2026-01-17)

Full Changelog: v1.19.0...v1.20.0

Features

  • client: add support for binary request streaming (b2af547)

Chores

  • internal: update actions/checkout version (04aae72)

This pull request is managed by Stainless's GitHub App.

The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.

For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.

🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions

@cursor
Copy link

cursor bot commented Jan 14, 2026

PR Summary

Introduces first-class binary request bodies and streaming.

  • Add content support to post/patch/put/delete (sync/async); reject mixing content with json_data/files and warn when passing raw bytes via body (deprecated)
  • Extend _build_request to send options.content; improve debug logging for Pydantic v1
  • Add BinaryTypes/AsyncBinaryTypes; include content in FinalRequestOptions
  • New tests for binary uploads (bytes, iterators, async iterators) and deprecation coverage
  • Bump actions/checkout to v6 in CI workflows; update version to 1.20.0 and changelog

Written by Cursor Bugbot for commit e650197. This will update automatically on new commits. Configure here.

@stainless-app
Copy link
Contributor Author

stainless-app bot commented Jan 14, 2026

🧪 Testing

To try out this version of the SDK, run:

pip install 'https://pkg.stainless.com/s/luma_ai-python/04aae7237e2b8289153bcf576ccc0882728efdf8/lumaai-1.19.0-py3-none-any.whl'

Expires at: Mon, 16 Feb 2026 05:44:58 GMT
Updated at: Sat, 17 Jan 2026 05:44:58 GMT

*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iterator content exhausted on retry sends empty body

High Severity

When content is an Iterable[bytes] (such as a generator), the retry logic fails silently. The model_copy at lines 972 and 982 performs a shallow copy, so the same iterator reference is shared across all retry attempts. After the first request consumes the iterator, subsequent retries send an empty body because the iterator is exhausted. With DEFAULT_MAX_RETRIES=2, this affects users by default when requests fail with 429, 500, or timeout errors.

Additional Locations (1)

Fix in Cursor Fix in Web

@stainless-app stainless-app bot force-pushed the release-please--branches--main--changes--next branch from 7477385 to e650197 Compare January 17, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant