diff --git a/src/engine/anthropic.ts b/src/engine/anthropic.ts index dcd9faa..5502f9d 100644 --- a/src/engine/anthropic.ts +++ b/src/engine/anthropic.ts @@ -48,15 +48,13 @@ if ( const MODEL = config?.OCO_MODEL; if (provider === 'anthropic' && - !MODEL_LIST.anthropic.includes(MODEL) && - command !== 'config' && - mode !== CONFIG_MODES.set) { - outro( - `${chalk.red('✖')} Unsupported model ${MODEL} for Anthropic. Supported models are: ${MODEL_LIST.anthropic.join( - ', ' - )}` - ); - process.exit(1); + MODEL.typeof !== 'string' && + command !== 'config' && + mode !== CONFIG_MODES.set) { +outro( + `${chalk.red('✖')} Unsupported model ${MODEL}. The model can be any string, but the current configuration is not supported.` +); +process.exit(1); } export class AnthropicAi implements AiEngine { diff --git a/src/engine/openAi.ts b/src/engine/openAi.ts index 4727f74..2d3f40e 100644 --- a/src/engine/openAi.ts +++ b/src/engine/openAi.ts @@ -54,15 +54,12 @@ if ( const MODEL = config?.OCO_MODEL || 'gpt-3.5-turbo'; if (provider === 'openai' && - !MODEL_LIST.openai.includes(MODEL) && + MODEL.typeof !== 'string' && command !== 'config' && mode !== CONFIG_MODES.set) { outro( - `${chalk.red('✖')} Unsupported model ${MODEL} for OpenAI. Supported models are: ${MODEL_LIST.openai.join( - ', ' - )}` + `${chalk.red('✖')} Unsupported model ${MODEL}. The model can be any string, but the current configuration is not supported.` ); - process.exit(1); }