@ai-sdk/google 2.0.36 → 2.0.38
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -7
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +13 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -6
- 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.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 42a6339: feat(google): `thinking_level` option for Gemini 3
|
|
8
|
+
|
|
9
|
+
## 2.0.37
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6de29ca: Prepare search tool for gemini-3-pro-preview
|
|
14
|
+
|
|
3
15
|
## 2.0.36
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -17,6 +17,7 @@ declare const googleGenerativeAIProviderOptions: _ai_sdk_provider_utils.LazySche
|
|
|
17
17
|
thinkingConfig?: {
|
|
18
18
|
thinkingBudget?: number | undefined;
|
|
19
19
|
includeThoughts?: boolean | undefined;
|
|
20
|
+
thinkingLevel?: "low" | "medium" | "high" | undefined;
|
|
20
21
|
} | undefined;
|
|
21
22
|
cachedContent?: string | undefined;
|
|
22
23
|
structuredOutputs?: boolean | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare const googleGenerativeAIProviderOptions: _ai_sdk_provider_utils.LazySche
|
|
|
17
17
|
thinkingConfig?: {
|
|
18
18
|
thinkingBudget?: number | undefined;
|
|
19
19
|
includeThoughts?: boolean | undefined;
|
|
20
|
+
thinkingLevel?: "low" | "medium" | "high" | undefined;
|
|
20
21
|
} | undefined;
|
|
21
22
|
cachedContent?: string | undefined;
|
|
22
23
|
structuredOutputs?: boolean | undefined;
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "2.0.
|
|
33
|
+
var VERSION = true ? "2.0.38" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -483,7 +483,9 @@ var googleGenerativeAIProviderOptions = (0, import_provider_utils5.lazySchema)(
|
|
|
483
483
|
responseModalities: import_v44.z.array(import_v44.z.enum(["TEXT", "IMAGE"])).optional(),
|
|
484
484
|
thinkingConfig: import_v44.z.object({
|
|
485
485
|
thinkingBudget: import_v44.z.number().optional(),
|
|
486
|
-
includeThoughts: import_v44.z.boolean().optional()
|
|
486
|
+
includeThoughts: import_v44.z.boolean().optional(),
|
|
487
|
+
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
488
|
+
thinkingLevel: import_v44.z.enum(["low", "medium", "high"]).optional()
|
|
487
489
|
}).optional(),
|
|
488
490
|
/**
|
|
489
491
|
* Optional.
|
|
@@ -587,7 +589,12 @@ function prepareTools({
|
|
|
587
589
|
var _a;
|
|
588
590
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
589
591
|
const toolWarnings = [];
|
|
590
|
-
const
|
|
592
|
+
const isLatest = [
|
|
593
|
+
"gemini-flash-latest",
|
|
594
|
+
"gemini-flash-lite-latest",
|
|
595
|
+
"gemini-pro-latest"
|
|
596
|
+
].some((id) => id === modelId);
|
|
597
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
591
598
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
592
599
|
const supportsFileSearch = modelId.includes("gemini-2.5");
|
|
593
600
|
if (tools == null) {
|
|
@@ -613,7 +620,7 @@ function prepareTools({
|
|
|
613
620
|
providerDefinedTools.forEach((tool) => {
|
|
614
621
|
switch (tool.id) {
|
|
615
622
|
case "google.google_search":
|
|
616
|
-
if (
|
|
623
|
+
if (isGemini2orNewer) {
|
|
617
624
|
googleTools2.push({ googleSearch: {} });
|
|
618
625
|
} else if (supportsDynamicRetrieval) {
|
|
619
626
|
googleTools2.push({
|
|
@@ -629,7 +636,7 @@ function prepareTools({
|
|
|
629
636
|
}
|
|
630
637
|
break;
|
|
631
638
|
case "google.url_context":
|
|
632
|
-
if (
|
|
639
|
+
if (isGemini2orNewer) {
|
|
633
640
|
googleTools2.push({ urlContext: {} });
|
|
634
641
|
} else {
|
|
635
642
|
toolWarnings.push({
|
|
@@ -640,7 +647,7 @@ function prepareTools({
|
|
|
640
647
|
}
|
|
641
648
|
break;
|
|
642
649
|
case "google.code_execution":
|
|
643
|
-
if (
|
|
650
|
+
if (isGemini2orNewer) {
|
|
644
651
|
googleTools2.push({ codeExecution: {} });
|
|
645
652
|
} else {
|
|
646
653
|
toolWarnings.push({
|
|
@@ -662,7 +669,7 @@ function prepareTools({
|
|
|
662
669
|
}
|
|
663
670
|
break;
|
|
664
671
|
case "google.vertex_rag_store":
|
|
665
|
-
if (
|
|
672
|
+
if (isGemini2orNewer) {
|
|
666
673
|
googleTools2.push({
|
|
667
674
|
retrieval: {
|
|
668
675
|
vertex_rag_store: {
|