Fix url key of createFileOutput options for streaming#350
Merged
aron merged 5 commits intoreplicate:mainfrom Nov 14, 2025
Merged
Fix url key of createFileOutput options for streaming#350aron merged 5 commits intoreplicate:mainfrom
aron merged 5 commits intoreplicate:mainfrom
Conversation
|
I have just spend at least two hours trying to find out what I'm doing wrong, trying to write the output to a file. Besides the fact that @zeke Could you merge at least this part of the suggested change? Not sure about the other half and the types, but for the wrong call there is no workaround. Thanks! |
The file streaming API is hosted at https://stream.replicate.com/v1/files so we can use this prefix to determine that the response will contain file entities. This is far cleaner than relying on the event contents.
Contributor
|
Thanks all for your contributions here. You're right this is a bug in the streaming logic. I've added some tests to verify the new behavior. Otherwise this looks great to me! |
aron
approved these changes
Nov 14, 2025
97b292c to
5e03835
Compare
Contributor
|
I will cut a new release shortly. |
Contributor
|
This has now been released as 1.4.0 |
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.
Currently, if you try to stream files you get a FileOutput instance in the following state:
This is because a
{ data, fetch }object is passed tocreateFileOutput, which expects a{ url, fetch }object.I also noticed that FileOutput is always used for streaming, so I added the useFileOutput option to the
*streamfunction and set the value ofReplicate.useFileOutputas default.