langcode
Version:
A Plugin-Based Framework for Managing and Using LangChain
24 lines (23 loc) • 1.55 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Langcode = void 0;
exports.langcode = langcode;
const PluginRunner_1 = require("./PluginRunner");
async function langcode(configList, options) {
var _a, _b, _c;
const runner = new PluginRunner_1.PluginRunner((_a = options === null || options === void 0 ? void 0 : options.debug) !== null && _a !== void 0 ? _a : !!(options === null || options === void 0 ? void 0 : options.logFile), (_b = options === null || options === void 0 ? void 0 : options.logFile) !== null && _b !== void 0 ? _b : null, (_c = options === null || options === void 0 ? void 0 : options.strict) !== null && _c !== void 0 ? _c : false);
await runner.initialize(configList);
return runner;
}
class Langcode extends PluginRunner_1.PluginRunner {
constructor(configList, options) {
var _a, _b, _c;
super((_a = options === null || options === void 0 ? void 0 : options.debug) !== null && _a !== void 0 ? _a : !!(options === null || options === void 0 ? void 0 : options.logFile), (_b = options === null || options === void 0 ? void 0 : options.logFile) !== null && _b !== void 0 ? _b : null, (_c = options === null || options === void 0 ? void 0 : options.strict) !== null && _c !== void 0 ? _c : false);
this.initialize(configList).then(() => {
console.log('PluginRunner initialized successfully');
}).catch(err => {
console.error('Error initializing PluginRunner', err);
});
}
}
exports.Langcode = Langcode;