mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-31 00:18:42 -05:00
add ollama support (#269)
* 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>
This commit is contained in:
13
src/utils/engine.ts
Normal file
13
src/utils/engine.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user