ai 2.2.17 → 2.2.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -550,7 +550,16 @@ interface Prediction {
550
550
  declare function ReplicateStream(res: Prediction, cb?: AIStreamCallbacksAndOptions): Promise<ReadableStream>;
551
551
 
552
552
  declare const nanoid: (size?: number | undefined) => string;
553
- declare function createChunkDecoder(complex?: boolean): (chunk: Uint8Array | undefined) => any;
553
+ declare function createChunkDecoder(): (chunk: Uint8Array | undefined) => string;
554
+ declare function createChunkDecoder(complex: false): (chunk: Uint8Array | undefined) => string;
555
+ declare function createChunkDecoder(complex: true): (chunk: Uint8Array | undefined) => {
556
+ type: keyof typeof StreamStringPrefixes;
557
+ value: string;
558
+ }[];
559
+ declare function createChunkDecoder(complex?: boolean): (chunk: Uint8Array | undefined) => {
560
+ type: keyof typeof StreamStringPrefixes;
561
+ value: string;
562
+ }[] | string;
554
563
 
555
564
  /**
556
565
  * The map of prefixes for data in the stream
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "2.2.17",
3
+ "version": "2.2.18",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -359,8 +359,10 @@ function useChat({
359
359
  messagesRef.current,
360
360
  functionCall
361
361
  );
362
- if (functionCallResponse === void 0)
362
+ if (functionCallResponse === void 0) {
363
+ hasFollowingResponse = false;
363
364
  break;
365
+ }
364
366
  chatRequest = functionCallResponse;
365
367
  }
366
368
  }
@@ -323,8 +323,10 @@ function useChat({
323
323
  messagesRef.current,
324
324
  functionCall
325
325
  );
326
- if (functionCallResponse === void 0)
326
+ if (functionCallResponse === void 0) {
327
+ hasFollowingResponse = false;
327
328
  break;
329
+ }
328
330
  chatRequest = functionCallResponse;
329
331
  }
330
332
  }