ai 6.0.0-beta.121 → 6.0.0-beta.122
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 +9 -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
|
@@ -775,7 +775,7 @@ import {
|
|
|
775
775
|
} from "@ai-sdk/provider-utils";
|
|
776
776
|
|
|
777
777
|
// src/version.ts
|
|
778
|
-
var VERSION = true ? "6.0.0-beta.
|
|
778
|
+
var VERSION = true ? "6.0.0-beta.122" : "0.0.0-test";
|
|
779
779
|
|
|
780
780
|
// src/util/download/download.ts
|
|
781
781
|
var download = async ({ url }) => {
|
|
@@ -3808,6 +3808,7 @@ import {
|
|
|
3808
3808
|
} from "@ai-sdk/provider";
|
|
3809
3809
|
import {
|
|
3810
3810
|
createIdGenerator as createIdGenerator2,
|
|
3811
|
+
DelayedPromise,
|
|
3811
3812
|
isAbortError as isAbortError2
|
|
3812
3813
|
} from "@ai-sdk/provider-utils";
|
|
3813
3814
|
|
|
@@ -4938,44 +4939,6 @@ function createStitchableStream() {
|
|
|
4938
4939
|
};
|
|
4939
4940
|
}
|
|
4940
4941
|
|
|
4941
|
-
// src/util/delayed-promise.ts
|
|
4942
|
-
var DelayedPromise = class {
|
|
4943
|
-
constructor() {
|
|
4944
|
-
this.status = { type: "pending" };
|
|
4945
|
-
this._resolve = void 0;
|
|
4946
|
-
this._reject = void 0;
|
|
4947
|
-
}
|
|
4948
|
-
get promise() {
|
|
4949
|
-
if (this._promise) {
|
|
4950
|
-
return this._promise;
|
|
4951
|
-
}
|
|
4952
|
-
this._promise = new Promise((resolve3, reject) => {
|
|
4953
|
-
if (this.status.type === "resolved") {
|
|
4954
|
-
resolve3(this.status.value);
|
|
4955
|
-
} else if (this.status.type === "rejected") {
|
|
4956
|
-
reject(this.status.error);
|
|
4957
|
-
}
|
|
4958
|
-
this._resolve = resolve3;
|
|
4959
|
-
this._reject = reject;
|
|
4960
|
-
});
|
|
4961
|
-
return this._promise;
|
|
4962
|
-
}
|
|
4963
|
-
resolve(value) {
|
|
4964
|
-
var _a15;
|
|
4965
|
-
this.status = { type: "resolved", value };
|
|
4966
|
-
if (this._promise) {
|
|
4967
|
-
(_a15 = this._resolve) == null ? void 0 : _a15.call(this, value);
|
|
4968
|
-
}
|
|
4969
|
-
}
|
|
4970
|
-
reject(error) {
|
|
4971
|
-
var _a15;
|
|
4972
|
-
this.status = { type: "rejected", error };
|
|
4973
|
-
if (this._promise) {
|
|
4974
|
-
(_a15 = this._reject) == null ? void 0 : _a15.call(this, error);
|
|
4975
|
-
}
|
|
4976
|
-
}
|
|
4977
|
-
};
|
|
4978
|
-
|
|
4979
4942
|
// src/util/now.ts
|
|
4980
4943
|
function now() {
|
|
4981
4944
|
var _a15, _b;
|
|
@@ -8724,7 +8687,8 @@ var DefaultGenerateObjectResult = class {
|
|
|
8724
8687
|
|
|
8725
8688
|
// src/generate-object/stream-object.ts
|
|
8726
8689
|
import {
|
|
8727
|
-
createIdGenerator as createIdGenerator4
|
|
8690
|
+
createIdGenerator as createIdGenerator4,
|
|
8691
|
+
DelayedPromise as DelayedPromise2
|
|
8728
8692
|
} from "@ai-sdk/provider-utils";
|
|
8729
8693
|
|
|
8730
8694
|
// src/util/cosine-similarity.ts
|
|
@@ -8948,13 +8912,13 @@ var DefaultStreamObjectResult = class {
|
|
|
8948
8912
|
currentDate,
|
|
8949
8913
|
now: now2
|
|
8950
8914
|
}) {
|
|
8951
|
-
this._object = new
|
|
8952
|
-
this._usage = new
|
|
8953
|
-
this._providerMetadata = new
|
|
8954
|
-
this._warnings = new
|
|
8955
|
-
this._request = new
|
|
8956
|
-
this._response = new
|
|
8957
|
-
this._finishReason = new
|
|
8915
|
+
this._object = new DelayedPromise2();
|
|
8916
|
+
this._usage = new DelayedPromise2();
|
|
8917
|
+
this._providerMetadata = new DelayedPromise2();
|
|
8918
|
+
this._warnings = new DelayedPromise2();
|
|
8919
|
+
this._request = new DelayedPromise2();
|
|
8920
|
+
this._response = new DelayedPromise2();
|
|
8921
|
+
this._finishReason = new DelayedPromise2();
|
|
8958
8922
|
const model = resolveLanguageModel(modelArg);
|
|
8959
8923
|
const { maxRetries, retry } = prepareRetries({
|
|
8960
8924
|
maxRetries: maxRetriesArg,
|