Skip to content

Commit

Permalink
feat: add Gemini 2.0 Flash Experimental support to Google AI and Vert…
Browse files Browse the repository at this point in the history
…ex AI plugins (#1499)
  • Loading branch information
pavelgj authored Dec 12, 2024
1 parent 540d3b7 commit 94a9ac8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
16 changes: 16 additions & 0 deletions js/plugins/googleai/src/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ export const gemini15Flash8b = modelRef({
configSchema: GeminiConfigSchema,
});

export const gemini20FlashExp = modelRef({
name: 'googleai/gemini-2.0-flash-exp',
info: {
label: 'Google AI - Gemini 2.0 Flash (Experimental)',
versions: [],
supports: {
multiturn: true,
media: true,
tools: true,
systemRole: true,
},
},
configSchema: GeminiConfigSchema,
});

export const SUPPORTED_V1_MODELS = {
'gemini-1.0-pro': gemini10Pro,
};
Expand All @@ -171,6 +186,7 @@ export const SUPPORTED_V15_MODELS = {
'gemini-1.5-pro': gemini15Pro,
'gemini-1.5-flash': gemini15Flash,
'gemini-1.5-flash-8b': gemini15Flash8b,
'gemini-2.0-flash-exp': gemini20FlashExp,
};

export const SUPPORTED_GEMINI_MODELS: Record<
Expand Down
11 changes: 10 additions & 1 deletion js/plugins/googleai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ import {
defineGoogleAIModel,
gemini10Pro,
gemini15Flash,
gemini15Flash8b,
gemini15Pro,
gemini20FlashExp,
} from './gemini.js';
export { gemini10Pro, gemini15Flash, gemini15Pro, textEmbeddingGecko001 };
export {
gemini10Pro,
gemini15Flash,
gemini15Flash8b,
gemini15Pro,
gemini20FlashExp,
textEmbeddingGecko001,
};

export interface PluginOptions {
apiKey?: string;
Expand Down
16 changes: 16 additions & 0 deletions js/plugins/vertexai/src/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,29 @@ export const gemini15Flash = modelRef({
configSchema: GeminiConfigSchema,
});

export const gemini20FlashExp = modelRef({
name: 'vertexai/gemini-2.0-flash-exp',
info: {
label: 'Vertex AI - Gemini 2.0 Flash (Experimental)',
versions: [],
supports: {
multiturn: true,
media: true,
tools: true,
systemRole: true,
},
},
configSchema: GeminiConfigSchema,
});

export const SUPPORTED_V1_MODELS = {
'gemini-1.0-pro': gemini10Pro,
};

export const SUPPORTED_V15_MODELS = {
'gemini-1.5-pro': gemini15Pro,
'gemini-1.5-flash': gemini15Flash,
'gemini-2.0-flash-exp': gemini20FlashExp,
};

export const SUPPORTED_GEMINI_MODELS = {
Expand Down
2 changes: 2 additions & 0 deletions js/plugins/vertexai/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
gemini10Pro,
gemini15Flash,
gemini15Pro,
gemini20FlashExp,
} from './gemini.js';
import {
SUPPORTED_IMAGEN_MODELS,
Expand All @@ -45,6 +46,7 @@ export {
gemini10Pro,
gemini15Flash,
gemini15Pro,
gemini20FlashExp,
imagen2,
imagen3,
imagen3Fast,
Expand Down

0 comments on commit 94a9ac8

Please sign in to comment.