@ai-sdk/google 3.0.45 → 3.0.47
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 +13 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -0
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal/index.js +13 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/convert-to-google-generative-ai-messages.ts +3 -0
- package/src/google-generative-ai-language-model.ts +28 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9d46b93: fix(provider/google): correctly mark reasoning files as such and fix related multi-turn errors
|
|
8
|
+
|
|
9
|
+
## 3.0.46
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [64ac0fd]
|
|
14
|
+
- @ai-sdk/provider-utils@4.0.20
|
|
15
|
+
|
|
3
16
|
## 3.0.45
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils16 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.
|
|
33
|
+
var VERSION = true ? "3.0.47" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -447,6 +447,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
447
447
|
mimeType: part.mediaType,
|
|
448
448
|
data: (0, import_provider_utils4.convertToBase64)(part.data)
|
|
449
449
|
},
|
|
450
|
+
...(providerOpts == null ? void 0 : providerOpts.thought) === true ? { thought: true } : {},
|
|
450
451
|
thoughtSignature
|
|
451
452
|
};
|
|
452
453
|
}
|
|
@@ -1092,13 +1093,16 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1092
1093
|
} : void 0
|
|
1093
1094
|
});
|
|
1094
1095
|
} else if ("inlineData" in part) {
|
|
1096
|
+
const hasThought = part.thought === true;
|
|
1097
|
+
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1095
1098
|
content.push({
|
|
1096
1099
|
type: "file",
|
|
1097
1100
|
data: part.inlineData.data,
|
|
1098
1101
|
mediaType: part.inlineData.mimeType,
|
|
1099
|
-
providerMetadata:
|
|
1102
|
+
providerMetadata: hasThought || hasThoughtSignature ? {
|
|
1100
1103
|
[providerOptionsName]: {
|
|
1101
|
-
|
|
1104
|
+
...hasThought ? { thought: true } : {},
|
|
1105
|
+
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1102
1106
|
}
|
|
1103
1107
|
} : void 0
|
|
1104
1108
|
});
|
|
@@ -1319,16 +1323,19 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1319
1323
|
});
|
|
1320
1324
|
currentReasoningBlockId = null;
|
|
1321
1325
|
}
|
|
1322
|
-
const
|
|
1326
|
+
const hasThought = part.thought === true;
|
|
1327
|
+
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1328
|
+
const fileMeta = hasThought || hasThoughtSignature ? {
|
|
1323
1329
|
[providerOptionsName]: {
|
|
1324
|
-
|
|
1330
|
+
...hasThought ? { thought: true } : {},
|
|
1331
|
+
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1325
1332
|
}
|
|
1326
1333
|
} : void 0;
|
|
1327
1334
|
controller.enqueue({
|
|
1328
1335
|
type: "file",
|
|
1329
1336
|
mediaType: part.inlineData.mimeType,
|
|
1330
1337
|
data: part.inlineData.data,
|
|
1331
|
-
providerMetadata:
|
|
1338
|
+
providerMetadata: fileMeta
|
|
1332
1339
|
});
|
|
1333
1340
|
}
|
|
1334
1341
|
}
|
|
@@ -1594,6 +1601,7 @@ var getContentSchema = () => import_v45.z.object({
|
|
|
1594
1601
|
mimeType: import_v45.z.string(),
|
|
1595
1602
|
data: import_v45.z.string()
|
|
1596
1603
|
}),
|
|
1604
|
+
thought: import_v45.z.boolean().nullish(),
|
|
1597
1605
|
thoughtSignature: import_v45.z.string().nullish()
|
|
1598
1606
|
}),
|
|
1599
1607
|
import_v45.z.object({
|