@ai-sdk/google 3.0.0-beta.47 → 3.0.0-beta.49
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 +8 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -14
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -13
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -13
- 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.49" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -600,7 +600,7 @@ function prepareTools({
|
|
|
600
600
|
"gemini-flash-lite-latest",
|
|
601
601
|
"gemini-pro-latest"
|
|
602
602
|
].some((id) => id === modelId);
|
|
603
|
-
const
|
|
603
|
+
const isGemini2orNewer = modelId.includes("gemini-2") || modelId.includes("gemini-3") || isLatest;
|
|
604
604
|
const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
|
|
605
605
|
const supportsFileSearch = modelId.includes("gemini-2.5");
|
|
606
606
|
if (tools == null) {
|
|
@@ -626,7 +626,7 @@ function prepareTools({
|
|
|
626
626
|
providerDefinedTools.forEach((tool) => {
|
|
627
627
|
switch (tool.id) {
|
|
628
628
|
case "google.google_search":
|
|
629
|
-
if (
|
|
629
|
+
if (isGemini2orNewer) {
|
|
630
630
|
googleTools2.push({ googleSearch: {} });
|
|
631
631
|
} else if (supportsDynamicRetrieval) {
|
|
632
632
|
googleTools2.push({
|
|
@@ -642,7 +642,7 @@ function prepareTools({
|
|
|
642
642
|
}
|
|
643
643
|
break;
|
|
644
644
|
case "google.url_context":
|
|
645
|
-
if (
|
|
645
|
+
if (isGemini2orNewer) {
|
|
646
646
|
googleTools2.push({ urlContext: {} });
|
|
647
647
|
} else {
|
|
648
648
|
toolWarnings.push({
|
|
@@ -653,7 +653,7 @@ function prepareTools({
|
|
|
653
653
|
}
|
|
654
654
|
break;
|
|
655
655
|
case "google.code_execution":
|
|
656
|
-
if (
|
|
656
|
+
if (isGemini2orNewer) {
|
|
657
657
|
googleTools2.push({ codeExecution: {} });
|
|
658
658
|
} else {
|
|
659
659
|
toolWarnings.push({
|
|
@@ -675,7 +675,7 @@ function prepareTools({
|
|
|
675
675
|
}
|
|
676
676
|
break;
|
|
677
677
|
case "google.vertex_rag_store":
|
|
678
|
-
if (
|
|
678
|
+
if (isGemini2orNewer) {
|
|
679
679
|
googleTools2.push({
|
|
680
680
|
retrieval: {
|
|
681
681
|
vertex_rag_store: {
|
|
@@ -825,19 +825,13 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
825
825
|
toolChoice,
|
|
826
826
|
providerOptions
|
|
827
827
|
}) {
|
|
828
|
-
var _a
|
|
828
|
+
var _a;
|
|
829
829
|
const warnings = [];
|
|
830
830
|
const googleOptions = await parseProviderOptions2({
|
|
831
831
|
provider: "google",
|
|
832
832
|
providerOptions,
|
|
833
833
|
schema: googleGenerativeAIProviderOptions
|
|
834
834
|
});
|
|
835
|
-
if (((_a = googleOptions == null ? void 0 : googleOptions.thinkingConfig) == null ? void 0 : _a.includeThoughts) === true && !this.config.provider.startsWith("google.vertex.")) {
|
|
836
|
-
warnings.push({
|
|
837
|
-
type: "other",
|
|
838
|
-
message: `The 'includeThoughts' option is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (${this.config.provider}).`
|
|
839
|
-
});
|
|
840
|
-
}
|
|
841
835
|
if ((tools == null ? void 0 : tools.some(
|
|
842
836
|
(tool) => tool.type === "provider-defined" && tool.id === "google.vertex_rag_store"
|
|
843
837
|
)) && !this.config.provider.startsWith("google.vertex.")) {
|
|
@@ -877,7 +871,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
877
871
|
responseSchema: (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && // Google GenAI does not support all OpenAPI Schema features,
|
|
878
872
|
// so this is needed as an escape hatch:
|
|
879
873
|
// TODO convert into provider option
|
|
880
|
-
((
|
|
874
|
+
((_a = googleOptions == null ? void 0 : googleOptions.structuredOutputs) != null ? _a : true) ? convertJSONSchemaToOpenAPISchema(responseFormat.schema) : void 0,
|
|
881
875
|
...(googleOptions == null ? void 0 : googleOptions.audioTimestamp) && {
|
|
882
876
|
audioTimestamp: googleOptions.audioTimestamp
|
|
883
877
|
},
|