Add streaming file upload support and AsyncCapture client#20
Draft
Add streaming file upload support and AsyncCapture client#20
Conversation
Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add streaming file upload support for large assets
Add streaming file upload support and AsyncCapture client
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both SDKs loaded entire files into memory before upload — a problem for large media files (100MB+ video). Python also lacked async support, creating a gap with TypeScript's inherently async API.
Python: Streaming Upload (
IO[bytes])FileInputnow includesIO[bytes]— file-like objects can be passed directly_normalize_file:str/Pathinputs now return an open file handle instead of reading all bytes;IO[bytes]inputs are passed through as-is_sha256_stream(): new helper computes SHA-256 via chunkedhashlibupdates, then seeks back to 0 for the upload — avoids double-buffering during signed registrationregister()/search_asset(): empty-check viaseek(0,2)/tell(); signing uses_sha256_stream;finallyblock closes handles opened from path inputsPython:
AsyncCaptureCapture1:1 usinghttpx.AsyncClient; all methods areasync defasync withcontext manager (__aenter__/__aexit__/aclose())numbersprotocol_capture.__all__TypeScript:
ReadableStreamInputReadableStreamtoFileInputunion typenormalizeFile()buffers stream chunks into aUint8Array— necessary since the Web Crypto API lacks incremental SHA-256 andFormDatadoesn't acceptReadableStreamdirectly in all environmentsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.