mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-04-20 03:02:51 -04:00
* add ollama support --------- Co-authored-by: di-sukharev <dim.sukharev@gmail.com> Co-authored-by: GPT10 <57486732+di-sukharev@users.noreply.github.com> Co-authored-by: Jaroslaw Weber <jaroslaw.weber@adriel.com>
14 lines
362 B
TypeScript
14 lines
362 B
TypeScript
import { AiEngine } from '../engine/Engine';
|
|
import { api } from '../engine/openAi';
|
|
import { getConfig } from '../commands/config';
|
|
import { ollamaAi } from '../engine/ollama';
|
|
|
|
export function getEngine(): AiEngine {
|
|
const config = getConfig();
|
|
if (config?.OCO_AI_PROVIDER == 'ollama') {
|
|
return ollamaAi;
|
|
}
|
|
//open ai gpt by default
|
|
return api;
|
|
}
|