Skip to content

Update gemini models #3115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/ai/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const GenerationCommonConfigSchema = z
.optional(),
stopSequences: z
.array(z.string())
.length(5)
.max(5)
.describe(
'Set of character sequences (up to 5) that will stop output generation.'
)
Expand Down
61 changes: 58 additions & 3 deletions js/plugins/googleai/src/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,40 @@ export const gemini25FlashPreview0417 = modelRef({
configSchema: GeminiConfigSchema,
});

export const gemini25FlashLitePreview0617 = modelRef({
name: 'googleai/gemini-2.5-flash-lite-preview-06-17',
info: {
label: 'Google AI - Gemini 2.5 Flash Lite Preview 06-17',
versions: [],
supports: {
multiturn: true,
media: true,
tools: true,
toolChoice: true,
systemRole: true,
constrained: 'no-tools',
},
},
configSchema: GeminiConfigSchema,
});

export const gemini25Flash = modelRef({
name: 'googleai/gemini-2.5-flash',
info: {
label: 'Google AI - Gemini 2.5 Flash',
versions: [],
supports: {
multiturn: true,
media: true,
tools: true,
toolChoice: true,
systemRole: true,
constrained: 'no-tools',
},
},
configSchema: GeminiConfigSchema,
});

export const gemini25FlashPreviewTts = modelRef({
name: 'googleai/gemini-2.5-flash-preview-tts',
info: {
Expand Down Expand Up @@ -418,10 +452,27 @@ export const gemini25ProExp0325 = modelRef({
configSchema: GeminiConfigSchema,
});

export const gemini25ProPreview0325 = modelRef({
name: 'googleai/gemini-2.5-pro-preview-03-25',
export const gemini25ProPreview0506 = modelRef({
name: 'googleai/gemini-2.5-pro-preview-05-06',
info: {
label: 'Google AI - Gemini 2.5 Pro Preview 05-06',
versions: [],
supports: {
multiturn: true,
media: true,
tools: true,
toolChoice: true,
systemRole: true,
constrained: 'no-tools',
},
},
configSchema: GeminiConfigSchema,
});

export const gemini25Pro = modelRef({
name: 'googleai/gemini-2.5-pro',
info: {
label: 'Google AI - Gemini 2.5 Pro Preview 03-25',
label: 'Google AI - Gemini 2.5 Pro',
versions: [],
supports: {
multiturn: true,
Expand Down Expand Up @@ -460,10 +511,14 @@ export const SUPPORTED_V15_MODELS = {
'gemini-2.0-flash': gemini20Flash,
'gemini-2.0-flash-lite': gemini20FlashLite,
'gemini-2.0-flash-exp': gemini20FlashExp,
'gemini-2.5-pro': gemini25Pro,
'gemini-2.5-pro-exp-03-25': gemini25ProExp0325,
'gemini-2.5-pro-preview-03-25': gemini25ProPreview0325,
'gemini-2.5-pro-preview-05-06': gemini25ProPreview0325,
'gemini-2.5-pro-preview-tts': gemini25ProPreviewTts,
'gemini-2.5-flash': gemini25Flash,
'gemini-2.5-flash-preview-04-17': gemini25FlashPreview0417,
'gemini-2.5-flash-lite-preview-06-17': gemini25FlashLitePreview0617,
'gemini-2.5-flash-preview-tts': gemini25FlashPreviewTts,
};

Expand Down
15 changes: 10 additions & 5 deletions js/plugins/googleai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
import {
GeminiConfigSchema,
SUPPORTED_GEMINI_MODELS,
SUPPORTED_V15_MODELS,
defineGoogleAIModel,
gemini,
gemini10Pro,
Expand All @@ -51,9 +50,12 @@ import {
gemini20FlashExp,
gemini20FlashLite,
gemini20ProExp0205,
gemini25Flash,
gemini25FlashPreview0417,
gemini25FlashLitePreview0617,
gemini25Pro,
gemini25ProExp0325,
gemini25ProPreview0325,
gemini25ProPreview0506,
type GeminiConfig,
type GeminiVersionString,
} from './gemini.js';
Expand Down Expand Up @@ -81,8 +83,11 @@ export {
gemini20FlashLite,
gemini20ProExp0205,
gemini25FlashPreview0417,
gemini25Flash,
gemini25FlashLitePreview0617,
gemini25ProExp0325,
gemini25ProPreview0325,
gemini25ProPreview0506,
gemini25Pro,
textEmbedding004,
textEmbeddingGecko001,
type GeminiConfig,
Expand Down Expand Up @@ -121,7 +126,7 @@ async function initializer(ai: Genkit, options?: PluginOptions) {
}

if (apiVersions.includes('v1beta')) {
Object.keys(SUPPORTED_V15_MODELS).forEach((name) =>
Object.keys(SUPPORTED_GEMINI_MODELS).forEach((name) =>
defineGoogleAIModel({
ai,
name,
Expand All @@ -133,7 +138,7 @@ async function initializer(ai: Genkit, options?: PluginOptions) {
);
}
if (apiVersions.includes('v1')) {
Object.keys(SUPPORTED_V15_MODELS).forEach((name) =>
Object.keys(SUPPORTED_GEMINI_MODELS).forEach((name) =>
defineGoogleAIModel({
ai,
name,
Expand Down