ai 4.1.20 → 4.1.22

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.mjs CHANGED
@@ -13,7 +13,8 @@ import {
13
13
  parseAssistantStreamPart,
14
14
  parseDataStreamPart,
15
15
  processDataStream,
16
- processTextStream
16
+ processTextStream,
17
+ zodSchema
17
18
  } from "@ai-sdk/ui-utils";
18
19
 
19
20
  // core/data-stream/create-data-stream.ts
@@ -4651,6 +4652,7 @@ function streamText({
4651
4652
  experimental_repairToolCall: repairToolCall,
4652
4653
  experimental_transform: transform,
4653
4654
  onChunk,
4655
+ onError,
4654
4656
  onFinish,
4655
4657
  onStepFinish,
4656
4658
  _internal: {
@@ -4681,6 +4683,7 @@ function streamText({
4681
4683
  continueSteps,
4682
4684
  providerOptions,
4683
4685
  onChunk,
4686
+ onError,
4684
4687
  onFinish,
4685
4688
  onStepFinish,
4686
4689
  now: now2,
@@ -4762,6 +4765,7 @@ var DefaultStreamTextResult = class {
4762
4765
  continueSteps,
4763
4766
  providerOptions,
4764
4767
  onChunk,
4768
+ onError,
4765
4769
  onFinish,
4766
4770
  onStepFinish,
4767
4771
  now: now2,
@@ -4813,6 +4817,9 @@ var DefaultStreamTextResult = class {
4813
4817
  if (part.type === "text-delta" || part.type === "reasoning" || part.type === "tool-call" || part.type === "tool-result" || part.type === "tool-call-streaming-start" || part.type === "tool-call-delta") {
4814
4818
  await (onChunk == null ? void 0 : onChunk({ chunk: part }));
4815
4819
  }
4820
+ if (part.type === "error") {
4821
+ await (onError == null ? void 0 : onError({ error: part.error }));
4822
+ }
4816
4823
  if (part.type === "text-delta") {
4817
4824
  recordedStepText += part.textDelta;
4818
4825
  recordedContinuationText += part.textDelta;
@@ -6568,6 +6575,7 @@ export {
6568
6575
  streamObject,
6569
6576
  streamText,
6570
6577
  tool,
6571
- wrapLanguageModel
6578
+ wrapLanguageModel,
6579
+ zodSchema
6572
6580
  };
6573
6581
  //# sourceMappingURL=index.mjs.map