ai 5.0.102 → 5.0.104
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/CHANGELOG.md +16 -0
- package/dist/index.js +12 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -47
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -684,7 +684,7 @@ import {
|
|
|
684
684
|
} from "@ai-sdk/provider-utils";
|
|
685
685
|
|
|
686
686
|
// src/version.ts
|
|
687
|
-
var VERSION = true ? "5.0.
|
|
687
|
+
var VERSION = true ? "5.0.104" : "0.0.0-test";
|
|
688
688
|
|
|
689
689
|
// src/util/download/download.ts
|
|
690
690
|
var download = async ({ url }) => {
|
|
@@ -2722,6 +2722,7 @@ import {
|
|
|
2722
2722
|
} from "@ai-sdk/provider";
|
|
2723
2723
|
import {
|
|
2724
2724
|
createIdGenerator as createIdGenerator2,
|
|
2725
|
+
DelayedPromise,
|
|
2725
2726
|
isAbortError as isAbortError2
|
|
2726
2727
|
} from "@ai-sdk/provider-utils";
|
|
2727
2728
|
|
|
@@ -4164,44 +4165,6 @@ function createStitchableStream() {
|
|
|
4164
4165
|
};
|
|
4165
4166
|
}
|
|
4166
4167
|
|
|
4167
|
-
// src/util/delayed-promise.ts
|
|
4168
|
-
var DelayedPromise = class {
|
|
4169
|
-
constructor() {
|
|
4170
|
-
this.status = { type: "pending" };
|
|
4171
|
-
this._resolve = void 0;
|
|
4172
|
-
this._reject = void 0;
|
|
4173
|
-
}
|
|
4174
|
-
get promise() {
|
|
4175
|
-
if (this._promise) {
|
|
4176
|
-
return this._promise;
|
|
4177
|
-
}
|
|
4178
|
-
this._promise = new Promise((resolve2, reject) => {
|
|
4179
|
-
if (this.status.type === "resolved") {
|
|
4180
|
-
resolve2(this.status.value);
|
|
4181
|
-
} else if (this.status.type === "rejected") {
|
|
4182
|
-
reject(this.status.error);
|
|
4183
|
-
}
|
|
4184
|
-
this._resolve = resolve2;
|
|
4185
|
-
this._reject = reject;
|
|
4186
|
-
});
|
|
4187
|
-
return this._promise;
|
|
4188
|
-
}
|
|
4189
|
-
resolve(value) {
|
|
4190
|
-
var _a16;
|
|
4191
|
-
this.status = { type: "resolved", value };
|
|
4192
|
-
if (this._promise) {
|
|
4193
|
-
(_a16 = this._resolve) == null ? void 0 : _a16.call(this, value);
|
|
4194
|
-
}
|
|
4195
|
-
}
|
|
4196
|
-
reject(error) {
|
|
4197
|
-
var _a16;
|
|
4198
|
-
this.status = { type: "rejected", error };
|
|
4199
|
-
if (this._promise) {
|
|
4200
|
-
(_a16 = this._reject) == null ? void 0 : _a16.call(this, error);
|
|
4201
|
-
}
|
|
4202
|
-
}
|
|
4203
|
-
};
|
|
4204
|
-
|
|
4205
4168
|
// src/util/now.ts
|
|
4206
4169
|
function now() {
|
|
4207
4170
|
var _a16, _b;
|
|
@@ -7229,7 +7192,8 @@ var DefaultGenerateObjectResult = class {
|
|
|
7229
7192
|
|
|
7230
7193
|
// src/generate-object/stream-object.ts
|
|
7231
7194
|
import {
|
|
7232
|
-
createIdGenerator as createIdGenerator4
|
|
7195
|
+
createIdGenerator as createIdGenerator4,
|
|
7196
|
+
DelayedPromise as DelayedPromise2
|
|
7233
7197
|
} from "@ai-sdk/provider-utils";
|
|
7234
7198
|
|
|
7235
7199
|
// src/util/cosine-similarity.ts
|
|
@@ -7453,13 +7417,13 @@ var DefaultStreamObjectResult = class {
|
|
|
7453
7417
|
currentDate,
|
|
7454
7418
|
now: now2
|
|
7455
7419
|
}) {
|
|
7456
|
-
this._object = new
|
|
7457
|
-
this._usage = new
|
|
7458
|
-
this._providerMetadata = new
|
|
7459
|
-
this._warnings = new
|
|
7460
|
-
this._request = new
|
|
7461
|
-
this._response = new
|
|
7462
|
-
this._finishReason = new
|
|
7420
|
+
this._object = new DelayedPromise2();
|
|
7421
|
+
this._usage = new DelayedPromise2();
|
|
7422
|
+
this._providerMetadata = new DelayedPromise2();
|
|
7423
|
+
this._warnings = new DelayedPromise2();
|
|
7424
|
+
this._request = new DelayedPromise2();
|
|
7425
|
+
this._response = new DelayedPromise2();
|
|
7426
|
+
this._finishReason = new DelayedPromise2();
|
|
7463
7427
|
const model = resolveLanguageModel(modelArg);
|
|
7464
7428
|
const { maxRetries, retry } = prepareRetries({
|
|
7465
7429
|
maxRetries: maxRetriesArg,
|