Skip to content
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

feat: add Gemini 2.0 Flash Experimental support to Google AI and Vertex AI plugins #1499

Merged
merged 1 commit into from
Dec 12, 2024
Merged
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
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
Loading