UNPKG

@gentrace/pinecone

Version:

Gentrace Pinecone v1 plugin for Node.JS

38 lines (35 loc) 1.53 kB
import { isConfig, GentracePlugin } from '@gentrace/core'; import { AdvancedPinecone } from './handlers/advanced.mjs'; var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const initPlugin = (configOrSimpleHandler) => __awaiter(void 0, void 0, void 0, function* () { if (isConfig(configOrSimpleHandler)) { return new PineconePlugin(configOrSimpleHandler); } return new PineconePlugin(configOrSimpleHandler.getConfig()); }); class PineconePlugin extends GentracePlugin { constructor(config) { super(); this.config = config; } getConfig() { return this.config; } advanced({ pipelineRun, gentraceConfig, }) { return new AdvancedPinecone({ pipelineRun, gentraceConfig, config: this.config, }); } } export { PineconePlugin, initPlugin }; //# sourceMappingURL=plugin.mjs.map