Skip to content

Commit 1cc51d9

Browse files
committed
Adds gpt-4o and gemini flash
1 parent 8a34758 commit 1cc51d9

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,6 +3512,7 @@
35123512
],
35133513
"default": null,
35143514
"enum": [
3515+
"gpt-4o",
35153516
"gpt-4-turbo",
35163517
"gpt-4-turbo-preview",
35173518
"gpt-4",
@@ -3520,6 +3521,7 @@
35203521
"gpt-3.5-turbo-16k"
35213522
],
35223523
"enumDescriptions": [
3524+
"GPT-4 Omni",
35233525
"GPT-4 Turbo with Vision",
35243526
"GPT-4 Turbo Preview",
35253527
"GPT-4",
@@ -3575,10 +3577,12 @@
35753577
"default": null,
35763578
"enum": [
35773579
"gemini-1.5-pro-latest",
3580+
"gemini-1.5-flash-latest",
35783581
"gemini-1.0-pro"
35793582
],
35803583
"enumDescriptions": [
35813584
"Gemini 1.5 Pro (Latest)",
3585+
"Gemini 1.5 Flash",
35823586
"Gemini 1.0 Pro"
35833587
],
35843588
"markdownDescription": "Specifies the Google Gemini model to use for GitLens' experimental AI features",

src/ai/geminiProvider.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getApiKey as getApiKeyCore, getMaxCharacters } from './aiProviderServic
1111

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

14-
export type GeminiModels = 'gemini-1.0-pro' | 'gemini-1.5-pro-latest';
14+
export type GeminiModels = 'gemini-1.0-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-flash-latest';
1515
type GeminiModel = AIModel<typeof provider.id>;
1616
const models: GeminiModel[] = [
1717
{
@@ -21,6 +21,12 @@ const models: GeminiModel[] = [
2121
provider: provider,
2222
default: true,
2323
},
24+
{
25+
id: 'gemini-1.5-flash-latest',
26+
name: 'Gemini 1.5 Flash',
27+
maxTokens: 1048576,
28+
provider: provider,
29+
},
2430
{
2531
id: 'gemini-1.0-pro',
2632
name: 'Gemini 1.0 Pro',

src/ai/openaiProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { getApiKey as getApiKeyCore, getMaxCharacters } from './aiProviderServic
1212
const provider = { id: 'openai', name: 'OpenAI' } as const;
1313

1414
export type OpenAIModels =
15+
| 'gpt-4o'
1516
| 'gpt-4-turbo'
1617
| 'gpt-4-turbo-2024-04-09'
1718
| 'gpt-4-turbo-preview'
@@ -28,6 +29,13 @@ export type OpenAIModels =
2829

2930
type OpenAIModel = AIModel<typeof provider.id>;
3031
const models: OpenAIModel[] = [
32+
{
33+
id: 'gpt-4o',
34+
name: 'GPT-4 Omni',
35+
maxTokens: 128000,
36+
provider: provider,
37+
default: true,
38+
},
3139
{
3240
id: 'gpt-4-turbo',
3341
name: 'GPT-4 Turbo with Vision',
@@ -46,7 +54,6 @@ const models: OpenAIModel[] = [
4654
name: 'GPT-4 Turbo Preview',
4755
maxTokens: 128000,
4856
provider: provider,
49-
default: true,
5057
},
5158
{
5259
id: 'gpt-4-0125-preview',

0 commit comments

Comments
 (0)