Files
mc-bot-town-2/nodejs/controller/ai/providers/index.js
T
2026-05-03 11:13:06 -04:00

32 lines
774 B
JavaScript

'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
};
/**
* Provider interface for tool support
* All providers must implement these methods:
* - setTools(tools): Configure available tools for function calling
* - supportsTools(): boolean - whether this provider supports tool calling
*/