mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-02-07 11:55:10 -05:00
support read OCO_OLLAMA_API_URL from env to OllamaAiEngine and fix bug in getting ollma model name when slash exists (#375)
This commit is contained in:
@@ -13,9 +13,11 @@ export function getEngine(): AiEngine {
|
||||
|
||||
if (provider?.startsWith('ollama')) {
|
||||
const ollamaAi = new OllamaAi();
|
||||
const model = provider.split('/')[1];
|
||||
if (model) ollamaAi.setModel(model);
|
||||
|
||||
const model = provider.substring('ollama/'.length);
|
||||
if (model) {
|
||||
ollamaAi.setModel(model);
|
||||
ollamaAi.setUrl(config?.OCO_OLLAMA_API_URL);
|
||||
}
|
||||
return ollamaAi;
|
||||
} else if (provider == 'anthropic') {
|
||||
return new AnthropicAi();
|
||||
|
||||
Reference in New Issue
Block a user