@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/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "3.0.
|
|
10
|
+
var VERSION = true ? "3.0.47" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -453,6 +453,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
453
453
|
mimeType: part.mediaType,
|
|
454
454
|
data: convertToBase64(part.data)
|
|
455
455
|
},
|
|
456
|
+
...(providerOpts == null ? void 0 : providerOpts.thought) === true ? { thought: true } : {},
|
|
456
457
|
thoughtSignature
|
|
457
458
|
};
|
|
458
459
|
}
|
|
@@ -1100,13 +1101,16 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1100
1101
|
} : void 0
|
|
1101
1102
|
});
|
|
1102
1103
|
} else if ("inlineData" in part) {
|
|
1104
|
+
const hasThought = part.thought === true;
|
|
1105
|
+
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1103
1106
|
content.push({
|
|
1104
1107
|
type: "file",
|
|
1105
1108
|
data: part.inlineData.data,
|
|
1106
1109
|
mediaType: part.inlineData.mimeType,
|
|
1107
|
-
providerMetadata:
|
|
1110
|
+
providerMetadata: hasThought || hasThoughtSignature ? {
|
|
1108
1111
|
[providerOptionsName]: {
|
|
1109
|
-
|
|
1112
|
+
...hasThought ? { thought: true } : {},
|
|
1113
|
+
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1110
1114
|
}
|
|
1111
1115
|
} : void 0
|
|
1112
1116
|
});
|
|
@@ -1327,16 +1331,19 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1327
1331
|
});
|
|
1328
1332
|
currentReasoningBlockId = null;
|
|
1329
1333
|
}
|
|
1330
|
-
const
|
|
1334
|
+
const hasThought = part.thought === true;
|
|
1335
|
+
const hasThoughtSignature = !!part.thoughtSignature;
|
|
1336
|
+
const fileMeta = hasThought || hasThoughtSignature ? {
|
|
1331
1337
|
[providerOptionsName]: {
|
|
1332
|
-
|
|
1338
|
+
...hasThought ? { thought: true } : {},
|
|
1339
|
+
...hasThoughtSignature ? { thoughtSignature: part.thoughtSignature } : {}
|
|
1333
1340
|
}
|
|
1334
1341
|
} : void 0;
|
|
1335
1342
|
controller.enqueue({
|
|
1336
1343
|
type: "file",
|
|
1337
1344
|
mediaType: part.inlineData.mimeType,
|
|
1338
1345
|
data: part.inlineData.data,
|
|
1339
|
-
providerMetadata:
|
|
1346
|
+
providerMetadata: fileMeta
|
|
1340
1347
|
});
|
|
1341
1348
|
}
|
|
1342
1349
|
}
|
|
@@ -1602,6 +1609,7 @@ var getContentSchema = () => z5.object({
|
|
|
1602
1609
|
mimeType: z5.string(),
|
|
1603
1610
|
data: z5.string()
|
|
1604
1611
|
}),
|
|
1612
|
+
thought: z5.boolean().nullish(),
|
|
1605
1613
|
thoughtSignature: z5.string().nullish()
|
|
1606
1614
|
}),
|
|
1607
1615
|
z5.object({
|