You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -133,7 +133,7 @@ class Replicate {
133
133
* @param {string} ref - Required. The model version identifier in the format "owner/name" or "owner/name:version"
134
134
* @param {object} options
135
135
* @param {object} options.input - Required. An object with the model inputs
136
-
* @param {object} [options.wait] - Options for waiting for the prediction to finish
136
+
* @param {object} [options.wait] - Options for waiting for the prediction to finish. If `wait` is explicitly true, the function will block and wait for the prediction to finish.
137
137
* @param {number} [options.wait.interval] - Polling interval in milliseconds. Defaults to 500
138
138
* @param {string} [options.webhook] - An HTTPS URL for receiving a webhook when the prediction has new output
139
139
* @param {string[]} [options.webhook_events_filter] - You can change which events trigger webhook requests by specifying webhook events (`start`|`output`|`logs`|`completed`)
@@ -144,20 +144,26 @@ class Replicate {
144
144
* @returns {Promise<object>} - Resolves with the output of running the model
145
145
*/
146
146
asyncrun(ref,options,progress){
147
+
let{ block }=options;
147
148
const{ wait, signal, ...data}=options;
148
149
150
+
// Block if `block` is explicitly true or if `wait` is explicitly true
0 commit comments