ai 7.0.94 → 7.0.95

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,11 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.95
4
+
5
+ ### Patch Changes
6
+
7
+ - 27f6d7a: fix(ai): reject embedding model responses that contain no embeddings
8
+
3
9
  ## 7.0.94
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1178,7 +1178,7 @@ import {
1178
1178
  } from "@ai-sdk/provider-utils";
1179
1179
 
1180
1180
  // src/version.ts
1181
- var VERSION = true ? "7.0.94" : "0.0.0-test";
1181
+ var VERSION = true ? "7.0.95" : "0.0.0-test";
1182
1182
 
1183
1183
  // src/util/download/download.ts
1184
1184
  var download = async ({
@@ -13043,6 +13043,12 @@ async function embed({
13043
13043
  },
13044
13044
  callbacks: [telemetryDispatcher.onEmbedEnd]
13045
13045
  });
13046
+ if (embedding2 == null) {
13047
+ throw new InvalidResponseDataError({
13048
+ data: modelResponse.embeddings,
13049
+ message: "No embedding generated."
13050
+ });
13051
+ }
13046
13052
  return {
13047
13053
  embedding: embedding2,
13048
13054
  usage: usage2,