ai 5.0.258 → 5.0.259

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # ai
2
2
 
3
+ ## 5.0.259
4
+
5
+ ### Patch Changes
6
+
7
+ - bf32c45: fix(ai): reject embedding model responses that contain no embeddings
8
+ - Updated dependencies [5728a51]
9
+ - Updated dependencies [6d3e199]
10
+ - @ai-sdk/gateway@2.0.153
11
+
3
12
  ## 5.0.258
4
13
 
5
14
  ### Patch Changes
package/dist/index.js CHANGED
@@ -816,7 +816,7 @@ function detectMediaType({
816
816
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
817
817
 
818
818
  // src/version.ts
819
- var VERSION = true ? "5.0.258" : "0.0.0-test";
819
+ var VERSION = true ? "5.0.259" : "0.0.0-test";
820
820
 
821
821
  // src/util/download/download.ts
822
822
  var download = async ({
@@ -6529,6 +6529,12 @@ async function embed({
6529
6529
  }
6530
6530
  })
6531
6531
  );
6532
+ if (embedding2 == null) {
6533
+ throw new import_provider17.InvalidResponseDataError({
6534
+ data: modelResponse.embeddings,
6535
+ message: "No embedding generated."
6536
+ });
6537
+ }
6532
6538
  return {
6533
6539
  embedding: embedding2,
6534
6540
  usage: usage2,