@depup/ai-sdk__google 3.0.43-depup.0 → 3.0.52-depup.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 +64 -0
- package/README.md +2 -2
- package/changes.json +1 -1
- package/dist/index.d.mts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +214 -65
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +211 -62
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +5 -1
- package/dist/internal/index.d.ts +5 -1
- package/dist/internal/index.js +170 -56
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +167 -53
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +30 -3
- package/package.json +4 -4
- package/src/convert-to-google-generative-ai-messages.ts +166 -32
- package/src/google-generative-ai-embedding-model.ts +37 -8
- package/src/google-generative-ai-embedding-options.ts +24 -0
- package/src/google-generative-ai-language-model.ts +64 -30
- package/src/google-generative-ai-prompt.ts +21 -2
- package/src/google-prepare-tools.ts +19 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.52
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 055cd68: fix: publish v6 to latest npm dist tag
|
|
8
|
+
- 47114a3: feat(provider/google): Add multimodal tool-result support for Google function responses.
|
|
9
|
+
|
|
10
|
+
Tool results with `output.type = 'content'` now map media parts into
|
|
11
|
+
`functionResponse.parts` for Google models, including `image-data`,
|
|
12
|
+
`file-data`, and base64 `data:` URLs in URL-style content parts.
|
|
13
|
+
Remote HTTP(S) URLs in URL-style tool-result parts are not supported.
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [055cd68]
|
|
16
|
+
- @ai-sdk/provider-utils@4.0.21
|
|
17
|
+
|
|
18
|
+
## 3.0.51
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 8901054: feat(google): add new finishMessage field in providerMetadata
|
|
23
|
+
|
|
24
|
+
## 3.0.50
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 5ffb1ad: feat(provider/google): add `gemini-embedding-2-preview` and fix multimodal embedding support with `embedMany`
|
|
29
|
+
|
|
30
|
+
## 3.0.49
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 85f4bb4: fix(provider/google): correct JSDoc for multimodal embedding content option
|
|
35
|
+
|
|
36
|
+
## 3.0.48
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- 35c46d1: feat(provider/google): support multimodal content parts in embedding provider options
|
|
41
|
+
|
|
42
|
+
## 3.0.47
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- 9d46b93: fix(provider/google): correctly mark reasoning files as such and fix related multi-turn errors
|
|
47
|
+
|
|
48
|
+
## 3.0.46
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [64ac0fd]
|
|
53
|
+
- @ai-sdk/provider-utils@4.0.20
|
|
54
|
+
|
|
55
|
+
## 3.0.45
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- e2a59ef: fix(provider/google): preserve groundingMetadata and urlContextMetadata when they arrive in a stream chunk before the finishReason chunk
|
|
60
|
+
|
|
61
|
+
## 3.0.44
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- 45d71c3: fix(google): use VALIDATED function calling mode when any tool has strict:true
|
|
66
|
+
|
|
3
67
|
## 3.0.43
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/ai-sdk__google
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@ai-sdk/google](https://www.npmjs.com/package/@ai-sdk/google) @ 3.0.
|
|
17
|
-
| Processed | 2026-03-
|
|
16
|
+
| Original | [@ai-sdk/google](https://www.npmjs.com/package/@ai-sdk/google) @ 3.0.52 |
|
|
17
|
+
| Processed | 2026-03-20 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -56,6 +56,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
56
56
|
mimeType: string;
|
|
57
57
|
data: string;
|
|
58
58
|
};
|
|
59
|
+
thought?: boolean | null | undefined;
|
|
59
60
|
thoughtSignature?: string | null | undefined;
|
|
60
61
|
} | {
|
|
61
62
|
executableCode?: {
|
|
@@ -72,6 +73,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
72
73
|
})[] | null | undefined;
|
|
73
74
|
} | null | undefined;
|
|
74
75
|
finishReason?: string | null | undefined;
|
|
76
|
+
finishMessage?: string | null | undefined;
|
|
75
77
|
safetyRatings?: {
|
|
76
78
|
category?: string | null | undefined;
|
|
77
79
|
probability?: string | null | undefined;
|
|
@@ -157,14 +159,21 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
157
159
|
type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
|
|
158
160
|
type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
|
|
159
161
|
type SafetyRatingSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['safetyRatings']>[number];
|
|
162
|
+
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
163
|
+
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
160
164
|
|
|
161
165
|
type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
|
|
162
166
|
type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
|
|
163
167
|
type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
|
|
168
|
+
type GoogleGenerativeAIPromptFeedback = PromptFeedbackSchema;
|
|
169
|
+
type GoogleGenerativeAIUsageMetadata = UsageMetadataSchema;
|
|
164
170
|
interface GoogleGenerativeAIProviderMetadata {
|
|
171
|
+
promptFeedback: GoogleGenerativeAIPromptFeedback | null;
|
|
165
172
|
groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
|
|
166
173
|
urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
|
|
167
174
|
safetyRatings: GoogleGenerativeAISafetyRating[] | null;
|
|
175
|
+
usageMetadata: GoogleGenerativeAIUsageMetadata | null;
|
|
176
|
+
finishMessage: string | null;
|
|
168
177
|
}
|
|
169
178
|
|
|
170
179
|
type GoogleGenerativeAIImageModelId = 'imagen-4.0-generate-001' | 'imagen-4.0-ultra-generate-001' | 'imagen-4.0-fast-generate-001' | 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
|
|
@@ -181,10 +190,18 @@ declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
181
190
|
}>;
|
|
182
191
|
type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
|
|
183
192
|
|
|
184
|
-
type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | (string & {});
|
|
193
|
+
type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2-preview' | (string & {});
|
|
185
194
|
declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
186
195
|
outputDimensionality?: number | undefined;
|
|
187
196
|
taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
|
|
197
|
+
content?: (({
|
|
198
|
+
text: string;
|
|
199
|
+
} | {
|
|
200
|
+
inlineData: {
|
|
201
|
+
mimeType: string;
|
|
202
|
+
data: string;
|
|
203
|
+
};
|
|
204
|
+
})[] | null)[] | undefined;
|
|
188
205
|
}>;
|
|
189
206
|
type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
|
|
190
207
|
|
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
56
56
|
mimeType: string;
|
|
57
57
|
data: string;
|
|
58
58
|
};
|
|
59
|
+
thought?: boolean | null | undefined;
|
|
59
60
|
thoughtSignature?: string | null | undefined;
|
|
60
61
|
} | {
|
|
61
62
|
executableCode?: {
|
|
@@ -72,6 +73,7 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
72
73
|
})[] | null | undefined;
|
|
73
74
|
} | null | undefined;
|
|
74
75
|
finishReason?: string | null | undefined;
|
|
76
|
+
finishMessage?: string | null | undefined;
|
|
75
77
|
safetyRatings?: {
|
|
76
78
|
category?: string | null | undefined;
|
|
77
79
|
probability?: string | null | undefined;
|
|
@@ -157,14 +159,21 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
157
159
|
type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
|
|
158
160
|
type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
|
|
159
161
|
type SafetyRatingSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['safetyRatings']>[number];
|
|
162
|
+
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
163
|
+
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
160
164
|
|
|
161
165
|
type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
|
|
162
166
|
type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
|
|
163
167
|
type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
|
|
168
|
+
type GoogleGenerativeAIPromptFeedback = PromptFeedbackSchema;
|
|
169
|
+
type GoogleGenerativeAIUsageMetadata = UsageMetadataSchema;
|
|
164
170
|
interface GoogleGenerativeAIProviderMetadata {
|
|
171
|
+
promptFeedback: GoogleGenerativeAIPromptFeedback | null;
|
|
165
172
|
groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
|
|
166
173
|
urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
|
|
167
174
|
safetyRatings: GoogleGenerativeAISafetyRating[] | null;
|
|
175
|
+
usageMetadata: GoogleGenerativeAIUsageMetadata | null;
|
|
176
|
+
finishMessage: string | null;
|
|
168
177
|
}
|
|
169
178
|
|
|
170
179
|
type GoogleGenerativeAIImageModelId = 'imagen-4.0-generate-001' | 'imagen-4.0-ultra-generate-001' | 'imagen-4.0-fast-generate-001' | 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
|
|
@@ -181,10 +190,18 @@ declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
181
190
|
}>;
|
|
182
191
|
type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
|
|
183
192
|
|
|
184
|
-
type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | (string & {});
|
|
193
|
+
type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2-preview' | (string & {});
|
|
185
194
|
declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
186
195
|
outputDimensionality?: number | undefined;
|
|
187
196
|
taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
|
|
197
|
+
content?: (({
|
|
198
|
+
text: string;
|
|
199
|
+
} | {
|
|
200
|
+
inlineData: {
|
|
201
|
+
mimeType: string;
|
|
202
|
+
data: string;
|
|
203
|
+
};
|
|
204
|
+
})[] | null)[] | undefined;
|
|
188
205
|
}>;
|
|
189
206
|
type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
|
|
190
207
|
|