Skip to content

Commit

Permalink
Adds gpt-4o and gemini flash
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed May 15, 2024
1 parent 8a34758 commit 1cc51d9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3512,6 +3512,7 @@
],
"default": null,
"enum": [
"gpt-4o",
"gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4",
Expand All @@ -3520,6 +3521,7 @@
"gpt-3.5-turbo-16k"
],
"enumDescriptions": [
"GPT-4 Omni",
"GPT-4 Turbo with Vision",
"GPT-4 Turbo Preview",
"GPT-4",
Expand Down Expand Up @@ -3575,10 +3577,12 @@
"default": null,
"enum": [
"gemini-1.5-pro-latest",
"gemini-1.5-flash-latest",
"gemini-1.0-pro"
],
"enumDescriptions": [
"Gemini 1.5 Pro (Latest)",
"Gemini 1.5 Flash",
"Gemini 1.0 Pro"
],
"markdownDescription": "Specifies the Google Gemini model to use for GitLens' experimental AI features",
Expand Down
8 changes: 7 additions & 1 deletion src/ai/geminiProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getApiKey as getApiKeyCore, getMaxCharacters } from './aiProviderServic

const provider = { id: 'gemini', name: 'Google' } as const;

export type GeminiModels = 'gemini-1.0-pro' | 'gemini-1.5-pro-latest';
export type GeminiModels = 'gemini-1.0-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-flash-latest';
type GeminiModel = AIModel<typeof provider.id>;
const models: GeminiModel[] = [
{
Expand All @@ -21,6 +21,12 @@ const models: GeminiModel[] = [
provider: provider,
default: true,
},
{
id: 'gemini-1.5-flash-latest',
name: 'Gemini 1.5 Flash',
maxTokens: 1048576,
provider: provider,
},
{
id: 'gemini-1.0-pro',
name: 'Gemini 1.0 Pro',
Expand Down
9 changes: 8 additions & 1 deletion src/ai/openaiProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { getApiKey as getApiKeyCore, getMaxCharacters } from './aiProviderServic
const provider = { id: 'openai', name: 'OpenAI' } as const;

export type OpenAIModels =
| 'gpt-4o'
| 'gpt-4-turbo'
| 'gpt-4-turbo-2024-04-09'
| 'gpt-4-turbo-preview'
Expand All @@ -28,6 +29,13 @@ export type OpenAIModels =

type OpenAIModel = AIModel<typeof provider.id>;
const models: OpenAIModel[] = [
{
id: 'gpt-4o',
name: 'GPT-4 Omni',
maxTokens: 128000,
provider: provider,
default: true,
},
{
id: 'gpt-4-turbo',
name: 'GPT-4 Turbo with Vision',
Expand All @@ -46,7 +54,6 @@ const models: OpenAIModel[] = [
name: 'GPT-4 Turbo Preview',
maxTokens: 128000,
provider: provider,
default: true,
},
{
id: 'gpt-4-0125-preview',
Expand Down

0 comments on commit 1cc51d9

Please sign in to comment.