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 (#1493)
  • Loading branch information
chrisraygill authored Dec 12, 2024
1 parent b2c2ad0 commit 908dfc1
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/core/src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ class Logger {
}
}

export const logger = new Logger();
export const logger = new Logger();
16 changes: 16 additions & 0 deletions js/plugins/googleai/src/gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,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 @@ -165,6 +180,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 @@ -126,13 +126,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 908dfc1

Please sign in to comment.