Add support for readable streams in AI binding#4294
Merged
anonrig merged 7 commits intocloudflare:mainfrom Jun 19, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Other comments (3)
-
src/cloudflare/internal/ai-api.ts (206-206)
Typo in error message: 'Muliple' should be 'Multiple'.
throw new AiInternalError(`Multiple ReadableStreams [${streamKeys}] are not supported`); - src/cloudflare/internal/test/ai/ai-api-test.js (104-104) There's a typo in the model name 'readableStreamIputs' (should be 'readableStreamInputs') that appears consistently throughout the tests.
- src/cloudflare/internal/test/ai/ai-api-test.js (218-218) There's a typo in the error message: 'Muliple ReadableStreams' should be 'Multiple ReadableStreams'.
💡 To request another review, post a new comment with "/windsurf-review".
8f211d0 to
48dc1a9
Compare
49f240f to
9ba37a6
Compare
Workers AI is extending its binding to allow for passing ReadableStreams as inputs, this will only be supported for a few models and will be fully backwards compatible. For newer models, users will be able to send bigger media files as raw JS ReadableStream objects. This will result in faster inference and interesting capabilities in future.
9ba37a6 to
f0c78ab
Compare
G4brym
approved these changes
Jun 18, 2025
f0c78ab to
2827e4b
Compare
2827e4b to
07ae33a
Compare
anonrig
reviewed
Jun 18, 2025
anonrig
approved these changes
Jun 19, 2025
anonrig
approved these changes
Jun 19, 2025
91f3a94 to
b0a5886
Compare
b0a5886 to
96dfc50
Compare
anonrig
approved these changes
Jun 19, 2025
penalosa
approved these changes
Jun 19, 2025
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.
Workers AI is extending its binding to allow for passing ReadableStreams as inputs,
this will only be supported for a few models and will be fully backwards compatible.
For newer models, users will be able to send bigger media files as raw JS ReadableStream
objects. This will result in faster inference responses.