donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
39 lines • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GptClientFactory = void 0;
const InvalidParamValueException_1 = require("../exceptions/InvalidParamValueException");
const AnthropicGptClient_1 = require("./AnthropicGptClient");
const GoogleGptClient_1 = require("./GoogleGptClient");
const OpenAiGptClient_1 = require("./OpenAiGptClient");
const AnthropicAwsBedrockGptClient_1 = require("./AnthropicAwsBedrockGptClient");
class GptClientFactory {
static async createFromGptConfig(config) {
let client;
switch (config.type) {
case 'ANTHROPIC':
client = new AnthropicGptClient_1.AnthropicGptClient(config);
break;
case 'GOOGLE_GEMINI':
client = new GoogleGptClient_1.GoogleGptClient(config);
break;
case 'OPENAI':
client = new OpenAiGptClient_1.OpenAiGptClient(config);
break;
case 'ANTHROPIC_AWS_BEDROCK':
client = new AnthropicAwsBedrockGptClient_1.AnthropicAwsBedrockGptClient(config);
break;
case 'OPENAI_AZURE':
// Unimplemented.
case 'LLAMA_LOCAL':
// Unimplemented.
case 'LLAMA_HUGGING_FACE':
// Unimplemented.
default:
throw new InvalidParamValueException_1.InvalidParamValueException('type', config.type);
}
await client.ping();
return client;
}
}
exports.GptClientFactory = GptClientFactory;
//# sourceMappingURL=GptClientFactory.js.map