@ai-sdk/google 4.0.0-beta.10 → 4.0.0-beta.11
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 +22 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -9
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +21 -8
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +21 -8
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/convert-to-google-generative-ai-messages.ts +18 -0
- package/src/google-generative-ai-language-model.ts +16 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f7d4f01: feat(provider): add support for `reasoning-file` type for files that are part of reasoning
|
|
8
|
+
- Updated dependencies [f7d4f01]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
10
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
11
|
+
|
|
3
12
|
## 4.0.0-beta.10
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
30
30
|
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "4.0.0-beta.
|
|
33
|
+
var VERSION = true ? "4.0.0-beta.11" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -471,6 +471,21 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
471
471
|
thoughtSignature
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
|
+
case "reasoning-file": {
|
|
475
|
+
if (part.data instanceof URL) {
|
|
476
|
+
throw new import_provider2.UnsupportedFunctionalityError({
|
|
477
|
+
functionality: "File data URLs in assistant messages are not supported"
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
return {
|
|
481
|
+
inlineData: {
|
|
482
|
+
mimeType: part.mediaType,
|
|
483
|
+
data: (0, import_provider_utils4.convertToBase64)(part.data)
|
|
484
|
+
},
|
|
485
|
+
thought: true,
|
|
486
|
+
thoughtSignature
|
|
487
|
+
};
|
|
488
|
+
}
|
|
474
489
|
case "file": {
|
|
475
490
|
if (part.data instanceof URL) {
|
|
476
491
|
throw new import_provider2.UnsupportedFunctionalityError({
|
|
@@ -1131,13 +1146,12 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1131
1146
|
const hasThought = part.thought === true;
|
|
1132
1147
|
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1133
1148
|
content.push({
|
|
1134
|
-
type: "file",
|
|
1149
|
+
type: hasThought ? "reasoning-file" : "file",
|
|
1135
1150
|
data: part.inlineData.data,
|
|
1136
1151
|
mediaType: part.inlineData.mimeType,
|
|
1137
|
-
providerMetadata:
|
|
1152
|
+
providerMetadata: hasThoughtSignature ? {
|
|
1138
1153
|
[providerOptionsName]: {
|
|
1139
|
-
|
|
1140
|
-
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1154
|
+
thoughtSignature: part.thoughtSignature
|
|
1141
1155
|
}
|
|
1142
1156
|
} : void 0
|
|
1143
1157
|
});
|
|
@@ -1361,14 +1375,13 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1361
1375
|
}
|
|
1362
1376
|
const hasThought = part.thought === true;
|
|
1363
1377
|
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1364
|
-
const fileMeta =
|
|
1378
|
+
const fileMeta = hasThoughtSignature ? {
|
|
1365
1379
|
[providerOptionsName]: {
|
|
1366
|
-
|
|
1367
|
-
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1380
|
+
thoughtSignature: part.thoughtSignature
|
|
1368
1381
|
}
|
|
1369
1382
|
} : void 0;
|
|
1370
1383
|
controller.enqueue({
|
|
1371
|
-
type: "file",
|
|
1384
|
+
type: hasThought ? "reasoning-file" : "file",
|
|
1372
1385
|
mediaType: part.inlineData.mimeType,
|
|
1373
1386
|
data: part.inlineData.data,
|
|
1374
1387
|
providerMetadata: fileMeta
|