Skip to content

Commit d09067c

Browse files
dkundelmattt
andauthored
Fix streaming example (#205)
* Fix streaming example The example to use replicate.stream was wrongly checking the event type and was not producing any output. * Update README.md Co-authored-by: Mattt <[email protected]> * Update README.md Co-authored-by: Mattt <[email protected]> * Update README.md Removing the console.dir since it's no longer relevant --------- Co-authored-by: Mattt <[email protected]>
1 parent 496d55a commit d09067c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,9 @@ const options = {
222222
};
223223
const output = [];
224224

225-
for await (const event of replicate.stream(model, options)) {
226-
console.debug({ event });
227-
if (event && event === "output") {
228-
output.push(event.data);
225+
for await (const { event, data } of replicate.stream(model, options)) {
226+
if (event === "output") {
227+
output.push(data);
229228
}
230229
}
231230

0 commit comments

Comments
 (0)