@ai-sdk/google 3.0.0-beta.88 → 3.0.0-beta.90
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 +16 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.90
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 218bba1: fix(google): use dynamic providerOptionsName when retrieving thoughtSignature in convertToGoogleGenerativeAIMessages
|
|
8
|
+
|
|
9
|
+
When using @ai-sdk/google-vertex provider with Gemini thinking models, multi-step tool calls would fail with "function call is missing a thought_signature" error. This was because thoughtSignature was stored under providerOptions.vertex but retrieved using hardcoded providerOptions.google. This fix passes providerOptionsName to convertToGoogleGenerativeAIMessages and uses it dynamically.
|
|
10
|
+
|
|
11
|
+
## 3.0.0-beta.89
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [475189e]
|
|
16
|
+
- @ai-sdk/provider@3.0.0-beta.32
|
|
17
|
+
- @ai-sdk/provider-utils@4.0.0-beta.59
|
|
18
|
+
|
|
3
19
|
## 3.0.0-beta.88
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.0-beta.
|
|
33
|
+
var VERSION = true ? "3.0.0-beta.90" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -366,11 +366,12 @@ function isEmptyObjectSchema(jsonSchema) {
|
|
|
366
366
|
var import_provider2 = require("@ai-sdk/provider");
|
|
367
367
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
368
368
|
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
369
|
-
var _a, _b;
|
|
369
|
+
var _a, _b, _c;
|
|
370
370
|
const systemInstructionParts = [];
|
|
371
371
|
const contents = [];
|
|
372
372
|
let systemMessagesAllowed = true;
|
|
373
373
|
const isGemmaModel = (_a = options == null ? void 0 : options.isGemmaModel) != null ? _a : false;
|
|
374
|
+
const providerOptionsName = (_b = options == null ? void 0 : options.providerOptionsName) != null ? _b : "google";
|
|
374
375
|
for (const { role, content } of prompt) {
|
|
375
376
|
switch (role) {
|
|
376
377
|
case "system": {
|
|
@@ -418,8 +419,9 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
418
419
|
contents.push({
|
|
419
420
|
role: "model",
|
|
420
421
|
parts: content.map((part) => {
|
|
421
|
-
var _a2
|
|
422
|
-
const
|
|
422
|
+
var _a2;
|
|
423
|
+
const providerOpts = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName];
|
|
424
|
+
const thoughtSignature = (providerOpts == null ? void 0 : providerOpts.thoughtSignature) != null ? String(providerOpts.thoughtSignature) : void 0;
|
|
423
425
|
switch (part.type) {
|
|
424
426
|
case "text": {
|
|
425
427
|
return part.text.length === 0 ? void 0 : {
|
|
@@ -508,7 +510,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
508
510
|
name: part.toolName,
|
|
509
511
|
response: {
|
|
510
512
|
name: part.toolName,
|
|
511
|
-
content: output.type === "execution-denied" ? (
|
|
513
|
+
content: output.type === "execution-denied" ? (_c = output.reason) != null ? _c : "Tool execution denied." : output.value
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
516
|
});
|
|
@@ -942,7 +944,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
942
944
|
const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
|
|
943
945
|
const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
|
|
944
946
|
prompt,
|
|
945
|
-
{ isGemmaModel }
|
|
947
|
+
{ isGemmaModel, providerOptionsName }
|
|
946
948
|
);
|
|
947
949
|
const {
|
|
948
950
|
tools: googleTools2,
|