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
|`options.version`| string |**Required**. The model version |
253
253
|`options.input`| object |**Required**. An object with the model's inputs |
254
+
|`options.stream`| boolean | Requests a URL for streaming output output |
254
255
|`options.webhook`| string | An HTTPS URL for receiving a webhook when the prediction has new output |
255
256
|`options.webhook_events_filter`| string[]| You can change which events trigger webhook requests by specifying webhook events (`start`\|`output`\|`logs`\|`completed`) |
Copy file name to clipboardExpand all lines: index.js
+44-30Lines changed: 44 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -80,15 +80,17 @@ class Replicate {
80
80
* @param {string} identifier - Required. The model version identifier in the format "{owner}/{name}:{version}"
81
81
* @param {object} options
82
82
* @param {object} options.input - Required. An object with the model inputs
83
-
* @param {object} [options.wait] - Whether to wait for the prediction to finish. Defaults to false
83
+
* @param {object} [options.wait] - Options for waiting for the prediction to finish
84
84
* @param {number} [options.wait.interval] - Polling interval in milliseconds. Defaults to 250
85
-
* @param {number} [options.wait.maxAttempts] - Maximum number of polling attempts. Defaults to no limit
85
+
* @param {number} [options.wait.max_attempts] - Maximum number of polling attempts. Defaults to no limit
86
86
* @param {string} [options.webhook] - An HTTPS URL for receiving a webhook when the prediction has new output
87
87
* @param {string[]} [options.webhook_events_filter] - You can change which events trigger webhook requests by specifying webhook events (`start`|`output`|`logs`|`completed`)
88
88
* @throws {Error} If the prediction failed
89
89
* @returns {Promise<object>} - Resolves with the output of running the model
90
90
*/
91
91
asyncrun(identifier,options){
92
+
const{ wait, ...data}=options;
93
+
92
94
// Define a pattern for owner and model names that allows
93
95
// letters, digits, and certain special characters.
0 commit comments