We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be0f323 commit 36b5f03Copy full SHA for 36b5f03
index.js
@@ -165,6 +165,15 @@ class Replicate {
165
throw new Error("Invalid model version identifier");
166
}
167
168
+ // When `wait` is set, the server may respond
169
+ // with the prediction output directly.
170
+ // If it hasn't finished, the prediction object is returned
171
+ // with an `id` property that can be used to poll for completion.
172
+ if (wait && !("id" in prediction)) {
173
+ const output = prediction;
174
+ return output;
175
+ }
176
+
177
// Call progress callback with the initial prediction object
178
if (progress) {
179
progress(prediction);
0 commit comments