forked from wmantly/mc-bot-town
craft fix
This commit is contained in:
25
nodejs/controller/ai/providers/index.js
Normal file
25
nodejs/controller/ai/providers/index.js
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
const GeminiProvider = require('./gemini');
|
||||
const OllamaProvider = require('./ollama');
|
||||
|
||||
class ProviderFactory {
|
||||
static create(config) {
|
||||
const provider = config.provider || 'gemini';
|
||||
|
||||
switch (provider.toLowerCase()) {
|
||||
case 'gemini':
|
||||
return new GeminiProvider(config);
|
||||
case 'ollama':
|
||||
return new OllamaProvider(config);
|
||||
default:
|
||||
throw new Error(`Unknown AI provider: ${provider}. Supported: 'gemini', 'ollama'`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
ProviderFactory,
|
||||
GeminiProvider,
|
||||
OllamaProvider
|
||||
};
|
||||
Reference in New Issue
Block a user