@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/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 ? "2.0.
|
|
10
|
+
var VERSION = true ? "2.0.38" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -492,7 +492,9 @@ var googleGenerativeAIProviderOptions = lazySchema4(
|
|
|
492
492
|
responseModalities: z4.array(z4.enum(["TEXT", "IMAGE"])).optional(),
|
|
493
493
|
thinkingConfig: z4.object({
|
|
494
494
|
thinkingBudget: z4.number().optional(),
|
|
495
|
-
includeThoughts: z4.boolean().optional()
|
|
495
|
+
includeThoughts: z4.boolean().optional(),
|
|
496
|
+
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
497
|
+
thinkingLevel: z4.enum(["low", "medium", "high"]).optional()
|
|
496
498
|
}).optional(),
|
|
497
499
|
/**
|
|
498
500
|
* Optional.
|
|
@@ -598,7 +600,12 @@ function prepareTools({
|
|
|
598
600
|
var _a;
|
|
599
601
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
600
602
|
const toolWarnings = [];
|
|
601
|
-
const
|
|
603
|
+
const isLatest = [
|
|
604
|
+
"gemini-flash-latest",
|
|
605
|
+
"gemini-flash-lite-latest",
|
|
606
|
+
"gemini-pro-latest"
|
|
607
|
+
].some((id) => id === modelId);
|
|
608
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
602
609
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
603
610
|
const supportsFileSearch = modelId.includes("gemini-2.5");
|
|
604
611
|
if (tools == null) {
|
|
@@ -624,7 +631,7 @@ function prepareTools({
|
|
|
624
631
|
providerDefinedTools.forEach((tool) => {
|
|
625
632
|
switch (tool.id) {
|
|
626
633
|
case "google.google_search":
|
|
627
|
-
if (
|
|
634
|
+
if (isGemini2orNewer) {
|
|
628
635
|
googleTools2.push({ googleSearch: {} });
|
|
629
636
|
} else if (supportsDynamicRetrieval) {
|
|
630
637
|
googleTools2.push({
|
|
@@ -640,7 +647,7 @@ function prepareTools({
|
|
|
640
647
|
}
|
|
641
648
|
break;
|
|
642
649
|
case "google.url_context":
|
|
643
|
-
if (
|
|
650
|
+
if (isGemini2orNewer) {
|
|
644
651
|
googleTools2.push({ urlContext: {} });
|
|
645
652
|
} else {
|
|
646
653
|
toolWarnings.push({
|
|
@@ -651,7 +658,7 @@ function prepareTools({
|
|
|
651
658
|
}
|
|
652
659
|
break;
|
|
653
660
|
case "google.code_execution":
|
|
654
|
-
if (
|
|
661
|
+
if (isGemini2orNewer) {
|
|
655
662
|
googleTools2.push({ codeExecution: {} });
|
|
656
663
|
} else {
|
|
657
664
|
toolWarnings.push({
|
|
@@ -673,7 +680,7 @@ function prepareTools({
|
|
|
673
680
|
}
|
|
674
681
|
break;
|
|
675
682
|
case "google.vertex_rag_store":
|
|
676
|
-
if (
|
|
683
|
+
if (isGemini2orNewer) {
|
|
677
684
|
googleTools2.push({
|
|
678
685
|
retrieval: {
|
|
679
686
|
vertex_rag_store: {
|