673eee209d
* 3.0.12 * build * feat: anthropic claude 3 support * fix: add system prompt * fix: type check * fix: package version * fix: update anthropic for dependency bug fix * feat: update build files * feat: update version number --------- Co-authored-by: di-sukharev <dim.sukharev@gmail.com>
20 lines
603 B
TypeScript
20 lines
603 B
TypeScript
import { AiEngine } from '../engine/Engine';
|
|
import { api } from '../engine/openAi';
|
|
import { getConfig } from '../commands/config';
|
|
import { ollamaAi } from '../engine/ollama';
|
|
import { anthropicAi } from '../engine/anthropic'
|
|
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 == 'anthropic') {
|
|
return anthropicAi;
|
|
} else if (config?.OCO_AI_PROVIDER == 'test') {
|
|
return testAi;
|
|
}
|
|
//open ai gpt by default
|
|
return api;
|
|
}
|