ai 7.0.90 → 7.0.92

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.
@@ -2143,7 +2143,7 @@ type GenerateTextEndEvent<TOOLS extends ToolSet = ToolSet, RUNTIME_CONTEXT exten
2143
2143
  readonly finalStep: StepResult<TOOLS, RUNTIME_CONTEXT>;
2144
2144
  };
2145
2145
  /**
2146
- * Event passed to the telemetry `onAbort` callback.
2146
+ * Event passed to an `onAbort` callback for text generation.
2147
2147
  *
2148
2148
  * Called when a streaming text generation operation is aborted before it
2149
2149
  * completes.
@@ -2591,9 +2591,11 @@ declare function prepareLanguageModelCallOptions({ maxOutputTokens, temperature,
2591
2591
  /**
2592
2592
  * Validate and prepare retries.
2593
2593
  */
2594
- declare function prepareRetries({ maxRetries, abortSignal, }: {
2594
+ declare function prepareRetries({ maxRetries, abortSignal, parameter, defaultMaxRetries, }: {
2595
2595
  maxRetries: number | undefined;
2596
2596
  abortSignal: AbortSignal | undefined;
2597
+ parameter?: string;
2598
+ defaultMaxRetries?: number;
2597
2599
  }): {
2598
2600
  maxRetries: number;
2599
2601
  retry: RetryFunction;
@@ -91,7 +91,7 @@ import {
91
91
  } from "@ai-sdk/provider-utils";
92
92
 
93
93
  // src/version.ts
94
- var VERSION = true ? "7.0.90" : "0.0.0-test";
94
+ var VERSION = true ? "7.0.92" : "0.0.0-test";
95
95
 
96
96
  // src/util/download/download.ts
97
97
  var download = async ({
@@ -1757,25 +1757,27 @@ var retryWithExponentialBackoffRespectingRetryHeaders = ({
1757
1757
  // src/util/prepare-retries.ts
1758
1758
  function prepareRetries({
1759
1759
  maxRetries,
1760
- abortSignal
1760
+ abortSignal,
1761
+ parameter = "maxRetries",
1762
+ defaultMaxRetries = 2
1761
1763
  }) {
1762
1764
  if (maxRetries != null) {
1763
1765
  if (!Number.isInteger(maxRetries)) {
1764
1766
  throw new InvalidArgumentError({
1765
- parameter: "maxRetries",
1767
+ parameter,
1766
1768
  value: maxRetries,
1767
- message: "maxRetries must be an integer"
1769
+ message: `${parameter} must be an integer`
1768
1770
  });
1769
1771
  }
1770
1772
  if (maxRetries < 0) {
1771
1773
  throw new InvalidArgumentError({
1772
- parameter: "maxRetries",
1774
+ parameter,
1773
1775
  value: maxRetries,
1774
- message: "maxRetries must be >= 0"
1776
+ message: `${parameter} must be >= 0`
1775
1777
  });
1776
1778
  }
1777
1779
  }
1778
- const maxRetriesResult = maxRetries != null ? maxRetries : 2;
1780
+ const maxRetriesResult = maxRetries != null ? maxRetries : defaultMaxRetries;
1779
1781
  return {
1780
1782
  maxRetries: maxRetriesResult,
1781
1783
  retry: retryWithExponentialBackoffRespectingRetryHeaders({