@ai-sdk/google 3.0.68 → 3.0.70
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 +14 -0
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -3
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/google-generative-ai-language-model.ts +1 -0
- package/src/google-prepare-tools.ts +6 -2
- package/src/interactions/convert-to-google-interactions-input.ts +9 -0
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.70" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -859,7 +859,8 @@ import {
|
|
|
859
859
|
function prepareTools({
|
|
860
860
|
tools,
|
|
861
861
|
toolChoice,
|
|
862
|
-
modelId
|
|
862
|
+
modelId,
|
|
863
|
+
isVertexProvider = false
|
|
863
864
|
}) {
|
|
864
865
|
var _a, _b;
|
|
865
866
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -995,7 +996,9 @@ function prepareTools({
|
|
|
995
996
|
}
|
|
996
997
|
const combinedToolConfig = {
|
|
997
998
|
functionCallingConfig: { mode: "VALIDATED" },
|
|
998
|
-
|
|
999
|
+
...!isVertexProvider && {
|
|
1000
|
+
includeServerSideToolInvocations: true
|
|
1001
|
+
}
|
|
999
1002
|
};
|
|
1000
1003
|
if (toolChoice != null) {
|
|
1001
1004
|
switch (toolChoice.type) {
|
|
@@ -1435,7 +1438,8 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
1435
1438
|
} = prepareTools({
|
|
1436
1439
|
tools,
|
|
1437
1440
|
toolChoice,
|
|
1438
|
-
modelId: this.modelId
|
|
1441
|
+
modelId: this.modelId,
|
|
1442
|
+
isVertexProvider
|
|
1439
1443
|
});
|
|
1440
1444
|
const streamFunctionCallArguments = isStreaming && isVertexProvider ? (_a = googleOptions == null ? void 0 : googleOptions.streamFunctionCallArguments) != null ? _a : false : void 0;
|
|
1441
1445
|
const toolConfig = googleToolConfig || streamFunctionCallArguments || (googleOptions == null ? void 0 : googleOptions.retrievalConfig) ? {
|
|
@@ -3808,6 +3812,15 @@ function convertToGoogleInteractionsInput({
|
|
|
3808
3812
|
...signature != null ? { signature } : {},
|
|
3809
3813
|
summary: part.text.length > 0 ? [{ type: "text", text: part.text }] : void 0
|
|
3810
3814
|
});
|
|
3815
|
+
} else if (part.type === "file") {
|
|
3816
|
+
const fileBlock = convertFilePartToContent({
|
|
3817
|
+
part,
|
|
3818
|
+
warnings,
|
|
3819
|
+
mediaResolution
|
|
3820
|
+
});
|
|
3821
|
+
if (fileBlock != null) {
|
|
3822
|
+
content.push(fileBlock);
|
|
3823
|
+
}
|
|
3811
3824
|
} else if (part.type === "tool-call") {
|
|
3812
3825
|
const signature = (_d = (_c = part.providerOptions) == null ? void 0 : _c.google) == null ? void 0 : _d.signature;
|
|
3813
3826
|
const args = typeof part.input === "string" ? safeParseToolArgs(part.input) : (_e = part.input) != null ? _e : {};
|