@@ -20,6 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
SOFTWARE.
21
21
***************************************************************************** */
22
22
23
+ /// <reference lib="es2018.asynciterable" />
24
+
23
25
/**
24
26
* Common interfaces and types
25
27
*/
@@ -261,7 +263,7 @@ declare namespace ICloud {
261
263
sendMessage : ( options : ICloudAICallbackOptions & ICloudBotOptions ) => Promise < ICloudAIStreamResult >
262
264
}
263
265
264
- interface ICloudBotOptions { data : any ; botId : string ; timeout ?: number }
266
+ interface ICloudBotOptions { data : any , botId : string , timeout ?: number }
265
267
interface ICloudAIModel {
266
268
streamText : ( opts : ICloudAIOptions & ICloudAICallbackOptions ) => Promise < ICloudAIStreamResult >
267
269
generateText : ( opts : ICloudAIOptions & ICloudAICallbackOptions ) => Promise < string >
@@ -285,10 +287,12 @@ declare namespace ICloud {
285
287
data : string
286
288
json ?: any
287
289
}
290
+
288
291
interface AsyncIterator < T > {
289
- next ( value ?: any ) : Promise < IteratorResult < T > > ;
290
- return ?( value ?: any ) : Promise < IteratorResult < T > > ;
291
- throw ?( e ?: any ) : Promise < IteratorResult < T > > ;
292
+ next ( value ?: any ) : Promise < IteratorResult < T > >
293
+ return ?( value ?: any ) : Promise < IteratorResult < T > >
294
+ throw ?( e ?: any ) : Promise < IteratorResult < T > >
295
+ [ Symbol . asyncIterator ] ( ) : AsyncIterableIterator < T >
292
296
}
293
297
interface ICloudAIStreamResult {
294
298
textStream : AsyncIterator < string >
0 commit comments