17 lines
523 B
JavaScript
17 lines
523 B
JavaScript
const { createAgentApiConnectorStrategy } = require("./agent-api");
|
|
const { createLocalCodexConnectorStrategy } = require("./local-codex");
|
|
|
|
function createConnectorStrategy(config) {
|
|
switch (config.type) {
|
|
case "agent-api":
|
|
return createAgentApiConnectorStrategy(config.agentApi);
|
|
case "local-codex":
|
|
return createLocalCodexConnectorStrategy(config.localCodex);
|
|
default:
|
|
throw new Error(`Unsupported connector type: ${config.type}`);
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
createConnectorStrategy,
|
|
};
|