ai 4.1.6 → 4.1.7

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
@@ -219,12 +219,7 @@ _a = symbol;
219
219
 
220
220
  // util/retry-with-exponential-backoff.ts
221
221
  import { APICallError } from "@ai-sdk/provider";
222
- import { getErrorMessage, isAbortError } from "@ai-sdk/provider-utils";
223
-
224
- // util/delay.ts
225
- async function delay(delayInMs) {
226
- return delayInMs == null ? Promise.resolve() : new Promise((resolve) => setTimeout(resolve, delayInMs));
227
- }
222
+ import { delay, getErrorMessage, isAbortError } from "@ai-sdk/provider-utils";
228
223
 
229
224
  // util/retry-error.ts
230
225
  import { AISDKError as AISDKError2 } from "@ai-sdk/provider";
@@ -4158,6 +4153,7 @@ var object = ({
4158
4153
 
4159
4154
  // core/generate-text/smooth-stream.ts
4160
4155
  import { InvalidArgumentError as InvalidArgumentError2 } from "@ai-sdk/provider";
4156
+ import { delay as originalDelay } from "@ai-sdk/provider-utils";
4161
4157
  var CHUNKING_REGEXPS = {
4162
4158
  word: /\s*\S+\s+/m,
4163
4159
  line: /[^\n]*\n/m
@@ -4165,7 +4161,7 @@ var CHUNKING_REGEXPS = {
4165
4161
  function smoothStream({
4166
4162
  delayInMs = 10,
4167
4163
  chunking = "word",
4168
- _internal: { delay: delay2 = delay } = {}
4164
+ _internal: { delay: delay2 = originalDelay } = {}
4169
4165
  } = {}) {
4170
4166
  const chunkingRegexp = typeof chunking === "string" ? CHUNKING_REGEXPS[chunking] : chunking;
4171
4167
  if (chunkingRegexp == null) {
@@ -5818,6 +5814,7 @@ function magnitude(vector) {
5818
5814
  }
5819
5815
 
5820
5816
  // core/util/simulate-readable-stream.ts
5817
+ import { delay as delayFunction } from "@ai-sdk/provider-utils";
5821
5818
  function simulateReadableStream({
5822
5819
  chunks,
5823
5820
  initialDelayInMs = 0,
@@ -5825,7 +5822,7 @@ function simulateReadableStream({
5825
5822
  _internal
5826
5823
  }) {
5827
5824
  var _a15;
5828
- const delay2 = (_a15 = _internal == null ? void 0 : _internal.delay) != null ? _a15 : delay;
5825
+ const delay2 = (_a15 = _internal == null ? void 0 : _internal.delay) != null ? _a15 : delayFunction;
5829
5826
  let index = 0;
5830
5827
  return new ReadableStream({
5831
5828
  async pull(controller) {