@@ -76,6 +76,16 @@ export const MODEL_LIST = {
7676 'gemini-1.0-pro' ,
7777 'gemini-pro-vision' ,
7878 'text-embedding-004'
79+ ] ,
80+
81+ groq : [
82+ 'llama3-70b-8192' , // Meta Llama 3 70B (default one, no daily token limit and 14 400 reqs/day)
83+ 'llama3-8b-8192' , // Meta Llama 3 8B
84+ 'llama-guard-3-8b' , // Llama Guard 3 8B
85+ 'llama-3.1-8b-instant' , // Llama 3.1 8B (Preview)
86+ 'llama-3.1-70b-versatile' , // Llama 3.1 70B (Preview)
87+ 'gemma-7b-it' , // Gemma 7B
88+ 'gemma2-9b-it' // Gemma 2 9B
7989 ]
8090} ;
8191
@@ -87,6 +97,8 @@ const getDefaultModel = (provider: string | undefined): string => {
8797 return MODEL_LIST . anthropic [ 0 ] ;
8898 case 'gemini' :
8999 return MODEL_LIST . gemini [ 0 ] ;
100+ case 'groq' :
101+ return MODEL_LIST . groq [ 0 ] ;
90102 default :
91103 return MODEL_LIST . openai [ 0 ] ;
92104 }
@@ -241,7 +253,7 @@ export const configValidators = {
241253
242254 validateConfig (
243255 CONFIG_KEYS . OCO_AI_PROVIDER ,
244- [ 'openai' , 'anthropic' , 'gemini' , 'azure' , 'test' , 'flowise' ] . includes (
256+ [ 'openai' , 'anthropic' , 'gemini' , 'azure' , 'test' , 'flowise' , 'groq' ] . includes (
245257 value
246258 ) || value . startsWith ( 'ollama' ) ,
247259 `${ value } is not supported yet, use 'ollama', 'anthropic', 'azure', 'gemini', 'flowise' or 'openai' (default)`
@@ -288,7 +300,8 @@ export enum OCO_AI_PROVIDER_ENUM {
288300 GEMINI = 'gemini' ,
289301 AZURE = 'azure' ,
290302 TEST = 'test' ,
291- FLOWISE = 'flowise'
303+ FLOWISE = 'flowise' ,
304+ GROQ = 'groq' ,
292305}
293306
294307export type ConfigType = {
@@ -388,7 +401,7 @@ const getEnvConfig = (envPath: string) => {
388401 OCO_EMOJI : parseConfigVarValue ( process . env . OCO_EMOJI ) ,
389402 OCO_LANGUAGE : process . env . OCO_LANGUAGE ,
390403 OCO_MESSAGE_TEMPLATE_PLACEHOLDER :
391- process . env . OCO_MESSAGE_TEMPLATE_PLACEHOLDER ,
404+ process . env . OCO_MESSAGE_TEMPLATE_PLACEHOLDER ,
392405 OCO_PROMPT_MODULE : process . env . OCO_PROMPT_MODULE as OCO_PROMPT_MODULE_ENUM ,
393406 OCO_ONE_LINE_COMMIT : parseConfigVarValue ( process . env . OCO_ONE_LINE_COMMIT ) ,
394407 OCO_TEST_MOCK_TYPE : process . env . OCO_TEST_MOCK_TYPE ,
@@ -445,9 +458,9 @@ interface GetConfigOptions {
445458}
446459
447460export const getConfig = ( {
448- envPath = defaultEnvPath ,
449- globalPath = defaultConfigPath
450- } : GetConfigOptions = { } ) : ConfigType => {
461+ envPath = defaultEnvPath ,
462+ globalPath = defaultConfigPath
463+ } : GetConfigOptions = { } ) : ConfigType => {
451464 const envConfig = getEnvConfig ( envPath ) ;
452465 const globalConfig = getGlobalConfig ( globalPath ) ;
453466
0 commit comments