🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ai-sdk/google

Package Overview
Dependencies
Maintainers
3
Versions
565
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/google - npm Package Compare versions

Comparing version
3.0.93
to
3.0.94
+6
-0
dist/index.d.mts

@@ -35,2 +35,8 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';

imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
imageOutputOptions?: {
mimeType?: "image/jpeg" | "image/png" | undefined;
compressionQuality?: number | undefined;
} | undefined;
} | undefined;

@@ -37,0 +43,0 @@ retrievalConfig?: {

@@ -35,2 +35,8 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';

imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
imageOutputOptions?: {
mimeType?: "image/jpeg" | "image/png" | undefined;
compressionQuality?: number | undefined;
} | undefined;
} | undefined;

@@ -37,0 +43,0 @@ retrievalConfig?: {

+1
-1
{
"name": "@ai-sdk/google",
"version": "3.0.93",
"version": "3.0.94",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -202,2 +202,31 @@ import type {

// personGeneration, prominentPeople and imageOutputOptions are only
// supported by the Vertex AI API, the Gemini API rejects them.
let imageConfig = googleOptions?.imageConfig;
if (imageConfig != null && !isVertexProvider) {
const {
personGeneration,
prominentPeople,
imageOutputOptions,
...geminiApiImageConfig
} = imageConfig;
const droppedImageConfigFields = Object.entries({
personGeneration,
prominentPeople,
imageOutputOptions,
})
.filter(([, value]) => value != null)
.map(([key]) => `'imageConfig.${key}'`);
if (droppedImageConfigFields.length > 0) {
warnings.push({
type: 'other',
message:
`${droppedImageConfigFields.join(', ')} ` +
`${droppedImageConfigFields.length === 1 ? 'is a Vertex AI option and is' : 'are Vertex AI options and are'} ` +
`ignored with the current Google provider (${this.config.provider}).`,
});
imageConfig = geminiApiImageConfig;
}
}
const isGemmaModel = this.modelId.toLowerCase().startsWith('gemma-');

@@ -297,5 +326,3 @@ const isGemini3Model = /^gemini-3[.-]/.test(this.modelId);

}),
...(googleOptions?.imageConfig && {
imageConfig: googleOptions.imageConfig,
}),
...(imageConfig && { imageConfig }),
},

@@ -302,0 +329,0 @@ contents,

@@ -177,2 +177,42 @@ import {

imageSize: z.enum(['1K', '2K', '4K', '512']).optional(),
/**
* Optional. Controls the generation of people in images.
* Vertex AI only.
*/
personGeneration: z
.enum([
'PERSON_GENERATION_UNSPECIFIED',
'ALLOW_ALL',
'ALLOW_ADULT',
'ALLOW_NONE',
])
.optional(),
/**
* Optional. Controls whether generation of prominent people
* (celebrities) is allowed. When set together with
* `personGeneration`, `personGeneration` takes precedence.
* Vertex AI only.
*
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig
*/
prominentPeople: z
.enum([
'PROMINENT_PEOPLE_UNSPECIFIED',
'ALLOW_PROMINENT_PEOPLE',
'BLOCK_PROMINENT_PEOPLE',
])
.optional(),
/**
* Optional. The image output format for generated images.
* Vertex AI only.
*/
imageOutputOptions: z
.object({
mimeType: z.enum(['image/jpeg', 'image/png']).optional(),
compressionQuality: z.number().optional(),
})
.optional(),
})

@@ -179,0 +219,0 @@ .optional(),

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display