@ai-sdk/google 3.0.0-beta.57 → 3.0.0-beta.59
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 +31 -0
- package/dist/index.d.mts +2 -6
- package/dist/index.d.ts +2 -6
- package/dist/index.js +24 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -21
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +18 -14
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +18 -14
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.59
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
|
|
8
|
+
- Updated dependencies [457318b]
|
|
9
|
+
- @ai-sdk/provider@3.0.0-beta.20
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.0-beta.37
|
|
11
|
+
|
|
12
|
+
## 3.0.0-beta.58
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
|
|
17
|
+
|
|
18
|
+
Before
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
model.textEmbeddingModel('my-model-id');
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
After
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
model.embeddingModel('my-model-id');
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [8d9e8ad]
|
|
31
|
+
- @ai-sdk/provider@3.0.0-beta.19
|
|
32
|
+
- @ai-sdk/provider-utils@4.0.0-beta.36
|
|
33
|
+
|
|
3
34
|
## 3.0.0-beta.57
|
|
4
35
|
|
|
5
36
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -238,12 +238,8 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
|
238
238
|
* @deprecated Use `chat()` instead.
|
|
239
239
|
*/
|
|
240
240
|
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
*/
|
|
244
|
-
embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
245
|
-
textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
246
|
-
textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
241
|
+
embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
|
|
242
|
+
embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
|
|
247
243
|
tools: typeof googleTools;
|
|
248
244
|
}
|
|
249
245
|
interface GoogleGenerativeAIProviderSettings {
|
package/dist/index.d.ts
CHANGED
|
@@ -238,12 +238,8 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
|
238
238
|
* @deprecated Use `chat()` instead.
|
|
239
239
|
*/
|
|
240
240
|
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
*/
|
|
244
|
-
embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
245
|
-
textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
246
|
-
textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3<string>;
|
|
241
|
+
embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
|
|
242
|
+
embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
|
|
247
243
|
tools: typeof googleTools;
|
|
248
244
|
}
|
|
249
245
|
interface GoogleGenerativeAIProviderSettings {
|
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 ? "3.0.0-beta.
|
|
33
|
+
var VERSION = true ? "3.0.0-beta.59" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -605,11 +605,9 @@ function prepareTools({
|
|
|
605
605
|
(tool) => tool.type === "provider-defined"
|
|
606
606
|
);
|
|
607
607
|
if (hasFunctionTools && hasProviderDefinedTools) {
|
|
608
|
-
const functionTools = tools.filter((tool) => tool.type === "function");
|
|
609
608
|
toolWarnings.push({
|
|
610
|
-
type: "unsupported
|
|
611
|
-
|
|
612
|
-
details: `Cannot mix function tools with provider-defined tools in the same request. Falling back to provider-defined tools only. The following function tools will be ignored: ${functionTools.map((t) => t.name).join(", ")}. Please use either function tools or provider-defined tools, but not both.`
|
|
609
|
+
type: "unsupported",
|
|
610
|
+
feature: `combination of function and provider-defined tools`
|
|
613
611
|
});
|
|
614
612
|
}
|
|
615
613
|
if (hasProviderDefinedTools) {
|
|
@@ -640,8 +638,8 @@ function prepareTools({
|
|
|
640
638
|
googleTools2.push({ urlContext: {} });
|
|
641
639
|
} else {
|
|
642
640
|
toolWarnings.push({
|
|
643
|
-
type: "unsupported
|
|
644
|
-
tool
|
|
641
|
+
type: "unsupported",
|
|
642
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
645
643
|
details: "The URL context tool is not supported with other Gemini models than Gemini 2."
|
|
646
644
|
});
|
|
647
645
|
}
|
|
@@ -651,8 +649,8 @@ function prepareTools({
|
|
|
651
649
|
googleTools2.push({ codeExecution: {} });
|
|
652
650
|
} else {
|
|
653
651
|
toolWarnings.push({
|
|
654
|
-
type: "unsupported
|
|
655
|
-
tool
|
|
652
|
+
type: "unsupported",
|
|
653
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
656
654
|
details: "The code execution tools is not supported with other Gemini models than Gemini 2."
|
|
657
655
|
});
|
|
658
656
|
}
|
|
@@ -662,8 +660,8 @@ function prepareTools({
|
|
|
662
660
|
googleTools2.push({ fileSearch: { ...tool.args } });
|
|
663
661
|
} else {
|
|
664
662
|
toolWarnings.push({
|
|
665
|
-
type: "unsupported
|
|
666
|
-
tool
|
|
663
|
+
type: "unsupported",
|
|
664
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
667
665
|
details: "The file search tool is only supported with Gemini 2.5 models."
|
|
668
666
|
});
|
|
669
667
|
}
|
|
@@ -682,14 +680,17 @@ function prepareTools({
|
|
|
682
680
|
});
|
|
683
681
|
} else {
|
|
684
682
|
toolWarnings.push({
|
|
685
|
-
type: "unsupported
|
|
686
|
-
tool
|
|
683
|
+
type: "unsupported",
|
|
684
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
687
685
|
details: "The RAG store tool is not supported with other Gemini models than Gemini 2."
|
|
688
686
|
});
|
|
689
687
|
}
|
|
690
688
|
break;
|
|
691
689
|
default:
|
|
692
|
-
toolWarnings.push({
|
|
690
|
+
toolWarnings.push({
|
|
691
|
+
type: "unsupported",
|
|
692
|
+
feature: `provider-defined tool ${tool.id}`
|
|
693
|
+
});
|
|
693
694
|
break;
|
|
694
695
|
}
|
|
695
696
|
});
|
|
@@ -710,7 +711,10 @@ function prepareTools({
|
|
|
710
711
|
});
|
|
711
712
|
break;
|
|
712
713
|
default:
|
|
713
|
-
toolWarnings.push({
|
|
714
|
+
toolWarnings.push({
|
|
715
|
+
type: "unsupported",
|
|
716
|
+
feature: `function tool ${tool.name}`
|
|
717
|
+
});
|
|
714
718
|
break;
|
|
715
719
|
}
|
|
716
720
|
}
|
|
@@ -1627,15 +1631,15 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
1627
1631
|
const warnings = [];
|
|
1628
1632
|
if (size != null) {
|
|
1629
1633
|
warnings.push({
|
|
1630
|
-
type: "unsupported
|
|
1631
|
-
|
|
1634
|
+
type: "unsupported",
|
|
1635
|
+
feature: "size",
|
|
1632
1636
|
details: "This model does not support the `size` option. Use `aspectRatio` instead."
|
|
1633
1637
|
});
|
|
1634
1638
|
}
|
|
1635
1639
|
if (seed != null) {
|
|
1636
1640
|
warnings.push({
|
|
1637
|
-
type: "unsupported
|
|
1638
|
-
|
|
1641
|
+
type: "unsupported",
|
|
1642
|
+
feature: "seed",
|
|
1639
1643
|
details: "This model does not support the `seed` option through this provider."
|
|
1640
1644
|
});
|
|
1641
1645
|
}
|
|
@@ -1768,8 +1772,7 @@ function createGoogleGenerativeAI(options = {}) {
|
|
|
1768
1772
|
provider.chat = createChatModel;
|
|
1769
1773
|
provider.generativeAI = createChatModel;
|
|
1770
1774
|
provider.embedding = createEmbeddingModel;
|
|
1771
|
-
provider.
|
|
1772
|
-
provider.textEmbeddingModel = createEmbeddingModel;
|
|
1775
|
+
provider.embeddingModel = createEmbeddingModel;
|
|
1773
1776
|
provider.image = createImageModel;
|
|
1774
1777
|
provider.imageModel = createImageModel;
|
|
1775
1778
|
provider.tools = googleTools;
|