improve OCO_AI_PROVIDER=ollama[/model name] (#327)
* 🐛 (config.ts, engine/ollama.ts, utils/engine.ts): improve Ollama AI configuration and usage ✨ (config.ts): add support for multiple Ollama models and allow users to specify the model in their config ✅ (engine/ollama.ts, utils/engine.ts): refactor code to use the specified Ollama model instead of hardcoding it * add build results
This commit is contained in:
@@ -82,7 +82,7 @@ export const configValidators = {
|
||||
//need api key unless running locally with ollama
|
||||
validateConfig(
|
||||
'OpenAI API_KEY',
|
||||
value || config.OCO_ANTHROPIC_API_KEY || config.OCO_AI_PROVIDER == 'ollama' || config.OCO_AI_PROVIDER == 'test',
|
||||
value || config.OCO_ANTHROPIC_API_KEY || config.OCO_AI_PROVIDER.startsWith('ollama') || config.OCO_AI_PROVIDER == 'test',
|
||||
'You need to provide an OpenAI/Anthropic API key'
|
||||
);
|
||||
validateConfig(
|
||||
@@ -223,10 +223,9 @@ export const configValidators = {
|
||||
'',
|
||||
'openai',
|
||||
'anthropic',
|
||||
'ollama',
|
||||
'test'
|
||||
].includes(value),
|
||||
`${value} is not supported yet, use 'ollama' 'anthropic' or 'openai' (default)`
|
||||
].includes(value) || value.startsWith('ollama'),
|
||||
`${value} is not supported yet, use 'ollama/{model}' 'anthropic' or 'openai' (default)`
|
||||
);
|
||||
return value;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user