replicate-javascript
replicate-javascript copied to clipboard
Fix url key of createFileOutput options for streaming
Currently, if you try to stream files you get a FileOutput instance in the following state:
FileOutput {
locked: false,
[state]: 'errored',
[supportsBYOB]: false,
[length]: undefined
}
This is because a { data, fetch } object is passed to createFileOutput, which expects a { url, fetch } object.
I also noticed that FileOutput is always used for streaming, so I added the useFileOutput option to the *stream function and set the value of Replicate.useFileOutput as default.