Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
di-sukharev
2024-08-18 14:23:26 +03:00
4 changed files with 30 additions and 26 deletions

View File

@@ -432,7 +432,8 @@ export const getConfig = ({
OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT || undefined,
OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE || 'commit-message',
OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT || ':',
OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY || undefined
OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY || undefined,
OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL || undefined
};
const configExists = existsSync(configPath);
if (!configExists) return configFromEnv;

View File

@@ -14,9 +14,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();