@ai-sdk/google 2.0.21 → 2.0.23
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 +12 -0
- package/dist/index.js +17 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -12
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +16 -11
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -11
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @ai-sdk/google
|
2
2
|
|
3
|
+
## 2.0.23
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 8a1d648: Fix adding google search along with url context in vertex ai
|
8
|
+
|
9
|
+
## 2.0.22
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- f8da995: The mediaResolution option has been added and is now passed to the Google API.
|
14
|
+
|
3
15
|
## 2.0.21
|
4
16
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
30
30
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
31
31
|
|
32
32
|
// src/version.ts
|
33
|
-
var VERSION = true ? "2.0.
|
33
|
+
var VERSION = true ? "2.0.23" : "0.0.0-test";
|
34
34
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
@@ -604,7 +604,7 @@ function prepareTools({
|
|
604
604
|
});
|
605
605
|
}
|
606
606
|
if (hasProviderDefinedTools) {
|
607
|
-
const googleTools2 =
|
607
|
+
const googleTools2 = [];
|
608
608
|
const providerDefinedTools = tools.filter(
|
609
609
|
(tool) => tool.type === "provider-defined"
|
610
610
|
);
|
@@ -612,21 +612,23 @@ function prepareTools({
|
|
612
612
|
switch (tool.id) {
|
613
613
|
case "google.google_search":
|
614
614
|
if (isGemini2) {
|
615
|
-
googleTools2.googleSearch
|
615
|
+
googleTools2.push({ googleSearch: {} });
|
616
616
|
} else if (supportsDynamicRetrieval) {
|
617
|
-
googleTools2.
|
618
|
-
|
619
|
-
|
620
|
-
|
617
|
+
googleTools2.push({
|
618
|
+
googleSearchRetrieval: {
|
619
|
+
dynamicRetrievalConfig: {
|
620
|
+
mode: tool.args.mode,
|
621
|
+
dynamicThreshold: tool.args.dynamicThreshold
|
622
|
+
}
|
621
623
|
}
|
622
|
-
};
|
624
|
+
});
|
623
625
|
} else {
|
624
|
-
googleTools2.googleSearchRetrieval
|
626
|
+
googleTools2.push({ googleSearchRetrieval: {} });
|
625
627
|
}
|
626
628
|
break;
|
627
629
|
case "google.url_context":
|
628
630
|
if (isGemini2) {
|
629
|
-
googleTools2.urlContext
|
631
|
+
googleTools2.push({ urlContext: {} });
|
630
632
|
} else {
|
631
633
|
toolWarnings.push({
|
632
634
|
type: "unsupported-tool",
|
@@ -637,7 +639,7 @@ function prepareTools({
|
|
637
639
|
break;
|
638
640
|
case "google.code_execution":
|
639
641
|
if (isGemini2) {
|
640
|
-
googleTools2.codeExecution
|
642
|
+
googleTools2.push({ codeExecution: {} });
|
641
643
|
} else {
|
642
644
|
toolWarnings.push({
|
643
645
|
type: "unsupported-tool",
|
@@ -652,7 +654,7 @@ function prepareTools({
|
|
652
654
|
}
|
653
655
|
});
|
654
656
|
return {
|
655
|
-
tools:
|
657
|
+
tools: googleTools2.length > 0 ? googleTools2 : void 0,
|
656
658
|
toolConfig: void 0,
|
657
659
|
toolWarnings
|
658
660
|
};
|
@@ -830,6 +832,9 @@ var GoogleGenerativeAILanguageModel = class {
|
|
830
832
|
thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig,
|
831
833
|
...(googleOptions == null ? void 0 : googleOptions.imageConfig) && {
|
832
834
|
imageConfig: googleOptions.imageConfig
|
835
|
+
},
|
836
|
+
...(googleOptions == null ? void 0 : googleOptions.mediaResolution) && {
|
837
|
+
mediaResolution: googleOptions.mediaResolution
|
833
838
|
}
|
834
839
|
},
|
835
840
|
contents,
|