@ai-sdk/google 3.0.0-beta.21 → 3.0.0-beta.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.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +37 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -13
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +36 -12
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +36 -12
- 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 ? "3.0.0-beta.
|
10
|
+
var VERSION = true ? "3.0.0-beta.23" : "0.0.0-test";
|
11
11
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
13
13
|
import {
|
@@ -559,7 +559,26 @@ var googleGenerativeAIProviderOptions = lazySchema4(
|
|
559
559
|
"MEDIA_RESOLUTION_LOW",
|
560
560
|
"MEDIA_RESOLUTION_MEDIUM",
|
561
561
|
"MEDIA_RESOLUTION_HIGH"
|
562
|
-
]).optional()
|
562
|
+
]).optional(),
|
563
|
+
/**
|
564
|
+
* Optional. Configures the image generation aspect ratio for Gemini models.
|
565
|
+
*
|
566
|
+
* https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
|
567
|
+
*/
|
568
|
+
imageConfig: z4.object({
|
569
|
+
aspectRatio: z4.enum([
|
570
|
+
"1:1",
|
571
|
+
"2:3",
|
572
|
+
"3:2",
|
573
|
+
"3:4",
|
574
|
+
"4:3",
|
575
|
+
"4:5",
|
576
|
+
"5:4",
|
577
|
+
"9:16",
|
578
|
+
"16:9",
|
579
|
+
"21:9"
|
580
|
+
]).optional()
|
581
|
+
}).optional()
|
563
582
|
})
|
564
583
|
)
|
565
584
|
);
|
@@ -598,7 +617,7 @@ function prepareTools({
|
|
598
617
|
});
|
599
618
|
}
|
600
619
|
if (hasProviderDefinedTools) {
|
601
|
-
const googleTools2 =
|
620
|
+
const googleTools2 = [];
|
602
621
|
const providerDefinedTools = tools.filter(
|
603
622
|
(tool) => tool.type === "provider-defined"
|
604
623
|
);
|
@@ -606,21 +625,23 @@ function prepareTools({
|
|
606
625
|
switch (tool.id) {
|
607
626
|
case "google.google_search":
|
608
627
|
if (isGemini2) {
|
609
|
-
googleTools2.googleSearch
|
628
|
+
googleTools2.push({ googleSearch: {} });
|
610
629
|
} else if (supportsDynamicRetrieval) {
|
611
|
-
googleTools2.
|
612
|
-
|
613
|
-
|
614
|
-
|
630
|
+
googleTools2.push({
|
631
|
+
googleSearchRetrieval: {
|
632
|
+
dynamicRetrievalConfig: {
|
633
|
+
mode: tool.args.mode,
|
634
|
+
dynamicThreshold: tool.args.dynamicThreshold
|
635
|
+
}
|
615
636
|
}
|
616
|
-
};
|
637
|
+
});
|
617
638
|
} else {
|
618
|
-
googleTools2.googleSearchRetrieval
|
639
|
+
googleTools2.push({ googleSearchRetrieval: {} });
|
619
640
|
}
|
620
641
|
break;
|
621
642
|
case "google.url_context":
|
622
643
|
if (isGemini2) {
|
623
|
-
googleTools2.urlContext
|
644
|
+
googleTools2.push({ urlContext: {} });
|
624
645
|
} else {
|
625
646
|
toolWarnings.push({
|
626
647
|
type: "unsupported-tool",
|
@@ -631,7 +652,7 @@ function prepareTools({
|
|
631
652
|
break;
|
632
653
|
case "google.code_execution":
|
633
654
|
if (isGemini2) {
|
634
|
-
googleTools2.codeExecution
|
655
|
+
googleTools2.push({ codeExecution: {} });
|
635
656
|
} else {
|
636
657
|
toolWarnings.push({
|
637
658
|
type: "unsupported-tool",
|
@@ -646,7 +667,7 @@ function prepareTools({
|
|
646
667
|
}
|
647
668
|
});
|
648
669
|
return {
|
649
|
-
tools:
|
670
|
+
tools: googleTools2.length > 0 ? googleTools2 : void 0,
|
650
671
|
toolConfig: void 0,
|
651
672
|
toolWarnings
|
652
673
|
};
|
@@ -824,6 +845,9 @@ var GoogleGenerativeAILanguageModel = class {
|
|
824
845
|
thinkingConfig: googleOptions == null ? void 0 : googleOptions.thinkingConfig,
|
825
846
|
...(googleOptions == null ? void 0 : googleOptions.mediaResolution) && {
|
826
847
|
mediaResolution: googleOptions.mediaResolution
|
848
|
+
},
|
849
|
+
...(googleOptions == null ? void 0 : googleOptions.imageConfig) && {
|
850
|
+
imageConfig: googleOptions.imageConfig
|
827
851
|
}
|
828
852
|
},
|
829
853
|
contents,
|