ai 2.1.24 → 2.1.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "2.1.24",
3
+ "version": "2.1.25",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -256,7 +256,9 @@ function useChat({
256
256
  }),
257
257
  {
258
258
  populateCache: false,
259
- revalidate: false
259
+ revalidate: false,
260
+ // @ts-expect-error - SWR tries to be clever with the throwOnError type
261
+ throwOnError: Boolean(!onError)
260
262
  }
261
263
  );
262
264
  const append = (0, import_react.useCallback)(
@@ -446,7 +448,9 @@ function useCompletion({
446
448
  }),
447
449
  {
448
450
  populateCache: false,
449
- revalidate: false
451
+ revalidate: false,
452
+ // @ts-expect-error - SWR tries to be clever with the throwOnError type
453
+ throwOnError: Boolean(onError)
450
454
  }
451
455
  );
452
456
  const stop = (0, import_react2.useCallback)(() => {
@@ -222,7 +222,9 @@ function useChat({
222
222
  }),
223
223
  {
224
224
  populateCache: false,
225
- revalidate: false
225
+ revalidate: false,
226
+ // @ts-expect-error - SWR tries to be clever with the throwOnError type
227
+ throwOnError: Boolean(!onError)
226
228
  }
227
229
  );
228
230
  const append = useCallback(
@@ -412,7 +414,9 @@ function useCompletion({
412
414
  }),
413
415
  {
414
416
  populateCache: false,
415
- revalidate: false
417
+ revalidate: false,
418
+ // @ts-expect-error - SWR tries to be clever with the throwOnError type
419
+ throwOnError: Boolean(onError)
416
420
  }
417
421
  );
418
422
  const stop = useCallback2(() => {