@ai-sdk/google 3.0.0-beta.89 → 3.0.0
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 +160 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -6
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +7 -5
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -5
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,165 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dee8b05: ai SDK 6 beta
|
|
8
|
+
|
|
9
|
+
### Minor Changes
|
|
10
|
+
|
|
11
|
+
- 78928cb: release: start 5.1 beta
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 0c3b58b: fix(provider): add specificationVersion to ProviderV3
|
|
16
|
+
- 0adc679: feat(provider): shared spec v3
|
|
17
|
+
- 9be07c8: feat(google): `thinking_level` option for Gemini 3
|
|
18
|
+
- fd788ce: fix(provider/google): preserve nested empty object schemas and descriptions in tool parameters
|
|
19
|
+
- 8d9e8ad: chore(provider): remove generics from EmbeddingModelV3
|
|
20
|
+
|
|
21
|
+
Before
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
model.textEmbeddingModel('my-model-id');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
After
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
model.embeddingModel('my-model-id');
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
- 2625a04: feat(openai); update spec for mcp approval
|
|
34
|
+
- 7728ac5: The mediaResolution option has been added and is now passed to the Google API.
|
|
35
|
+
- 9a728c8: support latest gemini model id
|
|
36
|
+
- 32a6c13: Add Google Maps grounding tool support for location-aware Gemini responses
|
|
37
|
+
- 95f65c2: chore: use import \* from zod/v4
|
|
38
|
+
- e300a3b: Fixed Zod validation error when using `google.tools.fileSearch()`. The Google File Search API returns `fileSearchStore` instead of `uri` in `retrievedContext`. Updated `extractSources()` function to handle both the old format (Google Search with `uri`) and new format (File Search with `fileSearchStore`), maintaining backward compatibility while preventing validation errors. Also fixed title handling to use `undefined` for URL sources and `'Unknown Document'` for document sources.
|
|
39
|
+
- 218bba1: fix(google): use dynamic providerOptionsName when retrieving thoughtSignature in convertToGoogleGenerativeAIMessages
|
|
40
|
+
|
|
41
|
+
When using @ai-sdk/google-vertex provider with Gemini thinking models, multi-step tool calls would fail with "function call is missing a thought_signature" error. This was because thoughtSignature was stored under providerOptions.vertex but retrieved using hardcoded providerOptions.google. This fix passes providerOptionsName to convertToGoogleGenerativeAIMessages and uses it dynamically.
|
|
42
|
+
|
|
43
|
+
- 954c356: feat(openai): allow custom names for provider-defined tools
|
|
44
|
+
- 0b92881: Add Google Vertex RAG Engine grounding provider tool
|
|
45
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
46
|
+
- 0c4822d: feat: `EmbeddingModelV3`
|
|
47
|
+
- f8c981f: Fix adding google search along with url context in vertex ai
|
|
48
|
+
- 6078060: fix(provider/google): remove includethoughts warning
|
|
49
|
+
- bb28cac: Change streamText loop to merge file part processing into main parts loop
|
|
50
|
+
- fff8d59: feat(provider/google): Add support for the imageSize provider option
|
|
51
|
+
- 1742445: Support for custom provider name in google and anthropic providers
|
|
52
|
+
- e8109d3: feat: tool execution approval
|
|
53
|
+
- ed329cb: feat: `Provider-V3`
|
|
54
|
+
- 3bd2689: feat: extended token usage
|
|
55
|
+
- 1cad0ab: feat: add provider version to user-agent header
|
|
56
|
+
- 9b17031: Improve error message when mixing function tools with provider-defined tools to clarify fallback behavior and list ignored function tools
|
|
57
|
+
- 8dac895: feat: `LanguageModelV3`
|
|
58
|
+
- ee50cc5: fix(provider/google): lazy schema loading
|
|
59
|
+
|
|
60
|
+
import time improved by 12.5% (22.3ms ➡️ 19.5ms)
|
|
61
|
+
|
|
62
|
+
- 457318b: chore(provider,ai): switch to SharedV3Warning and unified warnings
|
|
63
|
+
- 0ad470b: feat(provider/google): add enterpriseWebSearch tool
|
|
64
|
+
- db913bd: fix(google): add thought signature to gemini 3 pro image parts
|
|
65
|
+
- 9061dc0: feat: image editing
|
|
66
|
+
- 8370068: fix(provider/google): preserve thoughtSignature through tool execution
|
|
67
|
+
- ee8cd23: fix(vertex): allow 'vertex' as a key for providerOptions
|
|
68
|
+
- 7dea60e: add promptFeedback outputs
|
|
69
|
+
- 366f50b: chore(provider): add deprecated textEmbeddingModel and textEmbedding aliases
|
|
70
|
+
- 8ee8edc: Prepare search tool for gemini-3-pro-preview
|
|
71
|
+
- 2825757: Add Google File search tool
|
|
72
|
+
- 4616b86: chore: update zod peer depenedency version
|
|
73
|
+
- 33d9327: add `gemini-3-pro-preview` and `gemini-3-pro-image-preview` model IDs
|
|
74
|
+
- 0cfae4c: feat(vertex): support 'trafficType' in provider usageMetadata
|
|
75
|
+
- 09ba2dd: Support `imageConfig.aspectRatio` configuration for Gemini models
|
|
76
|
+
- 32a8c82: feat: add gemini 3 pro
|
|
77
|
+
- 166b6d7: fix(provider/google): preserve nested empty object schemas in tool parameters to fix "property is not defined" validation errors when using required properties with empty object types
|
|
78
|
+
- 522f6b8: feat: `ImageModelV3`
|
|
79
|
+
- 599a97f: fix: update gemini 3 model id
|
|
80
|
+
- 49e2b6a: fix(google): return request as object
|
|
81
|
+
- 3794514: feat: flexible tool output content support
|
|
82
|
+
- cbf52cd: feat: expose raw finish reason
|
|
83
|
+
- 870297d: feat(google): gemini-3-flash
|
|
84
|
+
- 10c1322: fix: moved dependency `@ai-sdk/test-server` to devDependencies
|
|
85
|
+
- c8003fb: fix(@ai-sdk/google): Make title field optional in grounding metadata schema
|
|
86
|
+
- 4d2e88e: fix(google,google-vertex): update known model IDs
|
|
87
|
+
- e833473: chore (provider/google): Add preview modelIds for gemini 2.5 flash and lite
|
|
88
|
+
- Updated dependencies [0c3b58b]
|
|
89
|
+
- Updated dependencies [0adc679]
|
|
90
|
+
- Updated dependencies [50b70d6]
|
|
91
|
+
- Updated dependencies [d1bdadb]
|
|
92
|
+
- Updated dependencies [dee8b05]
|
|
93
|
+
- Updated dependencies [046aa3b]
|
|
94
|
+
- Updated dependencies [8d9e8ad]
|
|
95
|
+
- Updated dependencies [78928cb]
|
|
96
|
+
- Updated dependencies [dce03c4]
|
|
97
|
+
- Updated dependencies [2625a04]
|
|
98
|
+
- Updated dependencies [37c58a0]
|
|
99
|
+
- Updated dependencies [3b1d015]
|
|
100
|
+
- Updated dependencies [2b0caef]
|
|
101
|
+
- Updated dependencies [95f65c2]
|
|
102
|
+
- Updated dependencies [016b111]
|
|
103
|
+
- Updated dependencies [58920e0]
|
|
104
|
+
- Updated dependencies [954c356]
|
|
105
|
+
- Updated dependencies [544d4e8]
|
|
106
|
+
- Updated dependencies [0c4822d]
|
|
107
|
+
- Updated dependencies [521c537]
|
|
108
|
+
- Updated dependencies [4c44a5b]
|
|
109
|
+
- Updated dependencies [e8109d3]
|
|
110
|
+
- Updated dependencies [03849b0]
|
|
111
|
+
- Updated dependencies [ed329cb]
|
|
112
|
+
- Updated dependencies [e06565c]
|
|
113
|
+
- Updated dependencies [32d8dbb]
|
|
114
|
+
- Updated dependencies [53f3368]
|
|
115
|
+
- Updated dependencies [d116b4b]
|
|
116
|
+
- Updated dependencies [3bd2689]
|
|
117
|
+
- Updated dependencies [293a6b7]
|
|
118
|
+
- Updated dependencies [703459a]
|
|
119
|
+
- Updated dependencies [bb36798]
|
|
120
|
+
- Updated dependencies [83e5744]
|
|
121
|
+
- Updated dependencies [7e32fea]
|
|
122
|
+
- Updated dependencies [3ed5519]
|
|
123
|
+
- Updated dependencies [8dac895]
|
|
124
|
+
- Updated dependencies [a755db5]
|
|
125
|
+
- Updated dependencies [cbb1d35]
|
|
126
|
+
- Updated dependencies [475189e]
|
|
127
|
+
- Updated dependencies [457318b]
|
|
128
|
+
- Updated dependencies [b681d7d]
|
|
129
|
+
- Updated dependencies [db913bd]
|
|
130
|
+
- Updated dependencies [9061dc0]
|
|
131
|
+
- Updated dependencies [32223c8]
|
|
132
|
+
- Updated dependencies [c1efac4]
|
|
133
|
+
- Updated dependencies [366f50b]
|
|
134
|
+
- Updated dependencies [4616b86]
|
|
135
|
+
- Updated dependencies [81d4308]
|
|
136
|
+
- Updated dependencies [9549c9e]
|
|
137
|
+
- Updated dependencies [af3780b]
|
|
138
|
+
- Updated dependencies [4f16c37]
|
|
139
|
+
- Updated dependencies [81e29ab]
|
|
140
|
+
- Updated dependencies [522f6b8]
|
|
141
|
+
- Updated dependencies [6306603]
|
|
142
|
+
- Updated dependencies [fca786b]
|
|
143
|
+
- Updated dependencies [763d04a]
|
|
144
|
+
- Updated dependencies [10d819b]
|
|
145
|
+
- Updated dependencies [3794514]
|
|
146
|
+
- Updated dependencies [cbf52cd]
|
|
147
|
+
- Updated dependencies [e9e157f]
|
|
148
|
+
- Updated dependencies [960ec8f]
|
|
149
|
+
- Updated dependencies [1bd7d32]
|
|
150
|
+
- Updated dependencies [f0b2157]
|
|
151
|
+
- Updated dependencies [95f65c2]
|
|
152
|
+
- @ai-sdk/provider@3.0.0
|
|
153
|
+
- @ai-sdk/provider-utils@4.0.0
|
|
154
|
+
|
|
155
|
+
## 3.0.0-beta.90
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- 218bba1: fix(google): use dynamic providerOptionsName when retrieving thoughtSignature in convertToGoogleGenerativeAIMessages
|
|
160
|
+
|
|
161
|
+
When using @ai-sdk/google-vertex provider with Gemini thinking models, multi-step tool calls would fail with "function call is missing a thought_signature" error. This was because thoughtSignature was stored under providerOptions.vertex but retrieved using hardcoded providerOptions.google. This fix passes providerOptionsName to convertToGoogleGenerativeAIMessages and uses it dynamically.
|
|
162
|
+
|
|
3
163
|
## 3.0.0-beta.89
|
|
4
164
|
|
|
5
165
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.0
|
|
33
|
+
var VERSION = true ? "3.0.0" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -366,11 +366,12 @@ function isEmptyObjectSchema(jsonSchema) {
|
|
|
366
366
|
var import_provider2 = require("@ai-sdk/provider");
|
|
367
367
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
368
368
|
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
369
|
-
var _a, _b;
|
|
369
|
+
var _a, _b, _c;
|
|
370
370
|
const systemInstructionParts = [];
|
|
371
371
|
const contents = [];
|
|
372
372
|
let systemMessagesAllowed = true;
|
|
373
373
|
const isGemmaModel = (_a = options == null ? void 0 : options.isGemmaModel) != null ? _a : false;
|
|
374
|
+
const providerOptionsName = (_b = options == null ? void 0 : options.providerOptionsName) != null ? _b : "google";
|
|
374
375
|
for (const { role, content } of prompt) {
|
|
375
376
|
switch (role) {
|
|
376
377
|
case "system": {
|
|
@@ -418,8 +419,9 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
418
419
|
contents.push({
|
|
419
420
|
role: "model",
|
|
420
421
|
parts: content.map((part) => {
|
|
421
|
-
var _a2
|
|
422
|
-
const
|
|
422
|
+
var _a2;
|
|
423
|
+
const providerOpts = (_a2 = part.providerOptions) == null ? void 0 : _a2[providerOptionsName];
|
|
424
|
+
const thoughtSignature = (providerOpts == null ? void 0 : providerOpts.thoughtSignature) != null ? String(providerOpts.thoughtSignature) : void 0;
|
|
423
425
|
switch (part.type) {
|
|
424
426
|
case "text": {
|
|
425
427
|
return part.text.length === 0 ? void 0 : {
|
|
@@ -508,7 +510,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
508
510
|
name: part.toolName,
|
|
509
511
|
response: {
|
|
510
512
|
name: part.toolName,
|
|
511
|
-
content: output.type === "execution-denied" ? (
|
|
513
|
+
content: output.type === "execution-denied" ? (_c = output.reason) != null ? _c : "Tool execution denied." : output.value
|
|
512
514
|
}
|
|
513
515
|
}
|
|
514
516
|
});
|
|
@@ -942,7 +944,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
942
944
|
const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
|
|
943
945
|
const { contents, systemInstruction } = convertToGoogleGenerativeAIMessages(
|
|
944
946
|
prompt,
|
|
945
|
-
{ isGemmaModel }
|
|
947
|
+
{ isGemmaModel, providerOptionsName }
|
|
946
948
|
);
|
|
947
949
|
const {
|
|
948
950
|
tools: googleTools2,
|