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: lib/predictions.js
+41-8Lines changed: 41 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
+
const{ Stream }=require('./stream');
2
+
1
3
/**
2
4
* Create a new prediction
3
5
*
4
-
* @typedef AsyncIterable
5
6
* @param {object} options
6
7
* @param {string} options.version - Required. The model version
7
8
* @param {object} options.input - Required. An object with the model inputs
@@ -11,7 +12,7 @@
11
12
* @param {string} [options.webhook] - An HTTPS URL for receiving a webhook when the prediction has new output
12
13
* @param {string[]} [options.webhook_events_filter] - You can change which events trigger webhook requests by specifying webhook events (`start`|`output`|`logs`|`completed`)
13
14
* @param {boolean} [options.stream] - Whether to stream the prediction output. Defaults to false
14
-
* @returns {Promise<object>|AsyncIterable<any>} Resolves with the created prediction, or a stream of prediction output if `options.stream` is `true`
15
+
* @returns {Promise<object>|Stream} Resolves with the created prediction, or a stream of prediction output if `options.stream` is `true`
15
16
*/
16
17
asyncfunctioncreatePrediction(options){
17
18
const{ wait, stream, ...data}=options;
@@ -34,23 +35,49 @@ async function createPrediction(options) {
0 commit comments