ai 5.1.0-beta.15 → 5.1.0-beta.17
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 +15 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/internal/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -461,15 +461,31 @@ var RetryError = class extends AISDKError17 {
|
|
|
461
461
|
_a15 = symbol15;
|
|
462
462
|
|
|
463
463
|
// src/model/resolve-model.ts
|
|
464
|
+
function transformToV3LanguageModel(model) {
|
|
465
|
+
return {
|
|
466
|
+
...model,
|
|
467
|
+
specificationVersion: "v3"
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
function transformToV3EmbeddingModel(model) {
|
|
471
|
+
return {
|
|
472
|
+
...model,
|
|
473
|
+
specificationVersion: "v3"
|
|
474
|
+
};
|
|
475
|
+
}
|
|
464
476
|
function resolveLanguageModel(model) {
|
|
465
477
|
if (typeof model !== "string") {
|
|
466
478
|
if (model.specificationVersion !== "v3" && model.specificationVersion !== "v2") {
|
|
479
|
+
const unsupportedModel = model;
|
|
467
480
|
throw new UnsupportedModelVersionError({
|
|
468
|
-
version:
|
|
469
|
-
provider:
|
|
470
|
-
modelId:
|
|
481
|
+
version: unsupportedModel.specificationVersion,
|
|
482
|
+
provider: unsupportedModel.provider,
|
|
483
|
+
modelId: unsupportedModel.modelId
|
|
471
484
|
});
|
|
472
485
|
}
|
|
486
|
+
if (model.specificationVersion === "v2") {
|
|
487
|
+
return transformToV3LanguageModel(model);
|
|
488
|
+
}
|
|
473
489
|
return model;
|
|
474
490
|
}
|
|
475
491
|
return getGlobalProvider().languageModel(model);
|
|
@@ -477,12 +493,16 @@ function resolveLanguageModel(model) {
|
|
|
477
493
|
function resolveEmbeddingModel(model) {
|
|
478
494
|
if (typeof model !== "string") {
|
|
479
495
|
if (model.specificationVersion !== "v3" && model.specificationVersion !== "v2") {
|
|
496
|
+
const unsupportedModel = model;
|
|
480
497
|
throw new UnsupportedModelVersionError({
|
|
481
|
-
version:
|
|
482
|
-
provider:
|
|
483
|
-
modelId:
|
|
498
|
+
version: unsupportedModel.specificationVersion,
|
|
499
|
+
provider: unsupportedModel.provider,
|
|
500
|
+
modelId: unsupportedModel.modelId
|
|
484
501
|
});
|
|
485
502
|
}
|
|
503
|
+
if (model.specificationVersion === "v2") {
|
|
504
|
+
return transformToV3EmbeddingModel(model);
|
|
505
|
+
}
|
|
486
506
|
return model;
|
|
487
507
|
}
|
|
488
508
|
return getGlobalProvider().textEmbeddingModel(
|
|
@@ -691,7 +711,7 @@ import {
|
|
|
691
711
|
} from "@ai-sdk/provider-utils";
|
|
692
712
|
|
|
693
713
|
// src/version.ts
|
|
694
|
-
var VERSION = true ? "5.1.0-beta.
|
|
714
|
+
var VERSION = true ? "5.1.0-beta.17" : "0.0.0-test";
|
|
695
715
|
|
|
696
716
|
// src/util/download/download.ts
|
|
697
717
|
var download = async ({ url }) => {
|