@@ -17,8 +17,8 @@ export const humanReadableProviderConfigKey: Record<string, string> = {
17
17
'apiBase' : 'Base URL'
18
18
} ;
19
19
20
- export type ProviderType = 'codestory' | 'openai-default' | 'azure-openai' | 'togetherai' | 'ollama' | 'openai-compatible' | 'anthropic' | 'fireworkai' ;
21
- export const providerTypeValues : ProviderType [ ] = [ 'codestory' , 'openai-default' , 'azure-openai' , 'togetherai' , 'ollama' , 'openai-compatible' , 'anthropic' , 'fireworkai' ] ;
20
+ export type ProviderType = 'codestory' | 'openai-default' | 'azure-openai' | 'togetherai' | 'ollama' | 'openai-compatible' | 'anthropic' | 'fireworkai' | 'geminipro' ;
21
+ export const providerTypeValues : ProviderType [ ] = [ 'codestory' , 'openai-default' , 'azure-openai' , 'togetherai' , 'ollama' , 'openai-compatible' , 'anthropic' , 'fireworkai' , 'geminipro' ] ;
22
22
23
23
export interface AzureOpenAIModelProviderConfig {
24
24
readonly type : 'azure-openai' ;
@@ -93,7 +93,13 @@ export interface FireworkAIProviderConfig {
93
93
readonly apiKey : string ;
94
94
}
95
95
96
- export type ProviderConfig = CodeStoryProviderConfig | OpenAIProviderConfig | AzureOpenAIProviderConfig | TogetherAIProviderConfig | OpenAICompatibleProviderConfig | OllamaProviderConfig | AnthropicProviderConfig | FireworkAIProviderConfig ;
96
+ export interface GeminiProProviderConfig {
97
+ readonly name : 'GeminiPro' ;
98
+ readonly apiKey : string ;
99
+ readonly apiBase : string ;
100
+ }
101
+
102
+ export type ProviderConfig = CodeStoryProviderConfig | OpenAIProviderConfig | AzureOpenAIProviderConfig | TogetherAIProviderConfig | OpenAICompatibleProviderConfig | OllamaProviderConfig | AnthropicProviderConfig | FireworkAIProviderConfig | GeminiProProviderConfig ;
97
103
export type ProviderConfigsWithAPIKey = Exclude < ProviderConfig , CodeStoryProviderConfig | OllamaProviderConfig > ;
98
104
99
105
export type IModelProviders =
@@ -104,7 +110,8 @@ export type IModelProviders =
104
110
| { 'openai-compatible' : OpenAICompatibleProviderConfig }
105
111
| { 'ollama' : OllamaProviderConfig }
106
112
| { 'anthropic' : AnthropicProviderConfig }
107
- | { 'fireworkai' : FireworkAIProviderConfig } ;
113
+ | { 'fireworkai' : FireworkAIProviderConfig }
114
+ | { 'geminipro' : GeminiProProviderConfig } ;
108
115
109
116
export function isModelProviderItem ( obj : any ) : obj is IModelProviders {
110
117
return obj && typeof obj === 'object'
@@ -262,7 +269,15 @@ export const defaultModelSelectionSettings: IModelSelectionSettings = {
262
269
provider : {
263
270
type : 'codestory'
264
271
}
265
- }
272
+ } ,
273
+ 'GeminiPro1.5' : {
274
+ name : 'Gemini Pro 1.5' ,
275
+ contextLength : 1000000 ,
276
+ temperature : 0.2 ,
277
+ provider : {
278
+ type : 'geminipro' ,
279
+ }
280
+ } ,
266
281
} ,
267
282
providers : {
268
283
'codestory' : {
@@ -297,6 +312,11 @@ export const defaultModelSelectionSettings: IModelSelectionSettings = {
297
312
name : 'Firework AI' ,
298
313
apiKey : '' ,
299
314
} ,
315
+ 'geminipro' : {
316
+ name : 'GeminiPro' ,
317
+ apiBase : '' ,
318
+ apiKey : '' ,
319
+ }
300
320
}
301
321
} ;
302
322
@@ -309,6 +329,7 @@ export const supportedModels: Record<ProviderType, string[]> = {
309
329
'ollama' : [ 'Mixtral' , 'MistralInstruct' , 'CodeLlama13BInstruct' , 'DeepSeekCoder1.3BInstruct' , 'DeepSeekCoder6BInstruct' , 'DeepSeekCoder33BInstruct' ] ,
310
330
'anthropic' : [ 'ClaudeOpus' , 'ClaudeSonnet' , 'ClaudeHaiku' ] ,
311
331
'fireworkai' : [ 'CodeLlama13BInstruct' ] ,
332
+ 'geminipro' : [ 'GeminiPro1.5' ] ,
312
333
} ;
313
334
314
335
export const providersSupportingModel = ( model : string ) : ProviderType [ ] => {
@@ -332,23 +353,23 @@ export const isDefaultProviderConfig = (key: ProviderType, config: ProviderConfi
332
353
const defaultConfig = defaultModelSelectionSettings . providers [ key as keyof IModelProviders ] as ProviderConfig ;
333
354
return defaultConfig
334
355
&& defaultConfig . name === config . name
335
- && ( defaultConfig . name === 'OpenAI' || defaultConfig . name === 'Together AI' || defaultConfig . name === 'Azure OpenAI' || defaultConfig . name === 'OpenAI Compatible' || defaultConfig . name === 'Anthropic' || defaultConfig . name === 'Firework AI'
356
+ && ( defaultConfig . name === 'OpenAI' || defaultConfig . name === 'Together AI' || defaultConfig . name === 'Azure OpenAI' || defaultConfig . name === 'OpenAI Compatible' || defaultConfig . name === 'Anthropic' || defaultConfig . name === 'Firework AI' || defaultConfig . name === 'GeminiPro'
336
357
? ( defaultConfig ) . apiKey === ( config as ProviderConfigsWithAPIKey ) . apiKey
337
358
: true
338
359
)
339
- && ( defaultConfig . name === 'Azure OpenAI' || defaultConfig . name === 'OpenAI Compatible'
360
+ && ( defaultConfig . name === 'Azure OpenAI' || defaultConfig . name === 'OpenAI Compatible' || defaultConfig . name === 'GeminiPro'
340
361
? defaultConfig . apiBase === ( config as BaseOpenAICompatibleProviderConfig ) . apiBase
341
362
: true
342
363
) ;
343
364
} ;
344
365
345
366
export const areProviderConfigsEqual = ( a : ProviderConfig , b : ProviderConfig ) => {
346
367
return a . name === b . name
347
- && ( a . name === 'OpenAI' || a . name === 'Together AI' || a . name === 'Azure OpenAI' || a . name === 'OpenAI Compatible' || a . name === 'Anthropic' || a . name === 'Firework AI'
368
+ && ( a . name === 'OpenAI' || a . name === 'Together AI' || a . name === 'Azure OpenAI' || a . name === 'OpenAI Compatible' || a . name === 'Anthropic' || a . name === 'Firework AI' || a . name === 'GeminiPro'
348
369
? ( a as ProviderConfigsWithAPIKey ) . apiKey === ( b as ProviderConfigsWithAPIKey ) . apiKey
349
370
: true
350
371
)
351
- && ( a . name === 'Azure OpenAI' || a . name === 'OpenAI Compatible'
372
+ && ( a . name === 'Azure OpenAI' || a . name === 'OpenAI Compatible' || a . name === 'GeminiPro'
352
373
? ( a as BaseOpenAICompatibleProviderConfig ) . apiBase === ( b as BaseOpenAICompatibleProviderConfig ) . apiBase
353
374
: true
354
375
) ;
0 commit comments