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
+9-5Lines changed: 9 additions & 5 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.
Copy file name to clipboardExpand all lines: lib/predictions.js
+1-14Lines changed: 1 addition & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,6 @@
4
4
* @param {object} options
5
5
* @param {string} options.version - Required. The model version
6
6
* @param {object} options.input - Required. An object with the model inputs
7
-
* @param {boolean|object} [options.wait] - Whether to wait for the prediction to finish. Defaults to false
8
-
* @param {number} [options.wait.interval] - Polling interval in milliseconds. Defaults to 250
9
-
* @param {number} [options.wait.maxAttempts] - Maximum number of polling attempts. Defaults to no limit
10
7
* @param {string} [options.webhook] - An HTTPS URL for receiving a webhook when the prediction has new output
11
8
* @param {string[]} [options.webhook_events_filter] - You can change which events trigger webhook requests by specifying webhook events (`start`|`output`|`logs`|`completed`)
12
9
* @param {boolean} [options.stream] - Whether to stream the prediction output. Defaults to false
@@ -26,19 +23,9 @@ async function createPrediction(options) {
0 commit comments