mirror of
https://github.com/di-sukharev/opencommit.git
synced 2026-01-30 16:08:14 -05:00
17 lines
474 B
TypeScript
17 lines
474 B
TypeScript
import { AiEngine } from '../engine/Engine';
|
|
import { api } from '../engine/openAi';
|
|
import { getConfig } from '../commands/config';
|
|
import { ollamaAi } from '../engine/ollama';
|
|
import { testAi } from '../engine/testAi';
|
|
|
|
export function getEngine(): AiEngine {
|
|
const config = getConfig();
|
|
if (config?.OCO_AI_PROVIDER == 'ollama') {
|
|
return ollamaAi;
|
|
} else if (config?.OCO_AI_PROVIDER == 'test') {
|
|
return testAi;
|
|
}
|
|
//open ai gpt by default
|
|
return api;
|
|
}
|