replicate-javascript icon indicating copy to clipboard operation
replicate-javascript copied to clipboard

Fix url key of createFileOutput options for streaming

Open sitatec opened this issue 9 months ago • 0 comments

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.

sitatec avatar Mar 29 '25 00:03 sitatec