@ai-sdk/google 3.0.138 → 3.0.140
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 +16 -0
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +570 -519
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +570 -519
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +544 -493
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +544 -493
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +18 -2
- package/package.json +2 -2
- package/src/convert-to-google-generative-ai-messages.ts +17 -5
- package/src/google-generative-ai-prompt.ts +21 -2
- package/src/google-json-accumulator.ts +52 -3
- package/src/index.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.140
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c9a131: Add videoMetadata support for file parts. Pass startOffset, endOffset, and fps through per-file providerOptions to control video clipping and frame rate with the Google and Google Vertex providers.
|
|
8
|
+
- Updated dependencies [28252da]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.63
|
|
10
|
+
|
|
11
|
+
## 3.0.139
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 08c1a86: fix(google): keep empty arrays and objects in tool-call input streamed with `streamFunctionCallArguments`
|
|
16
|
+
|
|
17
|
+
Vertex sends a value-less `partialArgs` entry for an empty container (e.g. `$.tags[]`), which was dropped, so `[]` and `{}` arguments went missing from the streamed tool-call input.
|
|
18
|
+
|
|
3
19
|
## 3.0.138
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -233,6 +233,13 @@ type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
|
233
233
|
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
234
234
|
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
235
235
|
|
|
236
|
+
declare const googleVideoMetadataSchema: z.ZodObject<{
|
|
237
|
+
startOffset: z.ZodOptional<z.ZodString>;
|
|
238
|
+
endOffset: z.ZodOptional<z.ZodString>;
|
|
239
|
+
fps: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
/** Metadata for preprocessing video file parts. */
|
|
242
|
+
type GoogleVideoMetadata = z.infer<typeof googleVideoMetadataSchema>;
|
|
236
243
|
type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
|
|
237
244
|
type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
|
|
238
245
|
type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
|
|
@@ -683,4 +690,4 @@ declare const google: GoogleGenerativeAIProvider;
|
|
|
683
690
|
|
|
684
691
|
declare const VERSION: string;
|
|
685
692
|
|
|
686
|
-
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, type GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, GoogleTranscriptionModel, type GoogleTranscriptionModelId, type GoogleTranscriptionModelOptions, type GoogleVideoModelOptions, VERSION, createGoogleGenerativeAI, google };
|
|
693
|
+
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, type GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, GoogleTranscriptionModel, type GoogleTranscriptionModelId, type GoogleTranscriptionModelOptions, type GoogleVideoMetadata, type GoogleVideoModelOptions, VERSION, createGoogleGenerativeAI, google };
|
package/dist/index.d.ts
CHANGED
|
@@ -233,6 +233,13 @@ type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
|
|
|
233
233
|
type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
|
|
234
234
|
type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
|
|
235
235
|
|
|
236
|
+
declare const googleVideoMetadataSchema: z.ZodObject<{
|
|
237
|
+
startOffset: z.ZodOptional<z.ZodString>;
|
|
238
|
+
endOffset: z.ZodOptional<z.ZodString>;
|
|
239
|
+
fps: z.ZodOptional<z.ZodNumber>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
/** Metadata for preprocessing video file parts. */
|
|
242
|
+
type GoogleVideoMetadata = z.infer<typeof googleVideoMetadataSchema>;
|
|
236
243
|
type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
|
|
237
244
|
type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
|
|
238
245
|
type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
|
|
@@ -683,4 +690,4 @@ declare const google: GoogleGenerativeAIProvider;
|
|
|
683
690
|
|
|
684
691
|
declare const VERSION: string;
|
|
685
692
|
|
|
686
|
-
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, type GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, GoogleTranscriptionModel, type GoogleTranscriptionModelId, type GoogleTranscriptionModelOptions, type GoogleVideoModelOptions, VERSION, createGoogleGenerativeAI, google };
|
|
693
|
+
export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, type GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleInteractionsAgentName, type GoogleInteractionsModelId, type GoogleInteractionsProviderMetadata, type GoogleLanguageModelInteractionsOptions, type GoogleLanguageModelOptions, GoogleTranscriptionModel, type GoogleTranscriptionModelId, type GoogleTranscriptionModelOptions, type GoogleVideoMetadata, type GoogleVideoModelOptions, VERSION, createGoogleGenerativeAI, google };
|