UNPKG

rag-cli-tester

Version:

A lightweight CLI tool for testing RAG (Retrieval-Augmented Generation) systems with different embedding combinations

28 lines 911 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MetricFactory = void 0; class MetricFactory { static registerMetric(name, metric) { this.metrics.set(name.toLowerCase(), metric); } static getMetric(name) { const metric = this.metrics.get(name.toLowerCase()); if (!metric) { throw new Error(`Metric '${name}' not found. Available metrics: ${Array.from(this.metrics.keys()).join(', ')}`); } return metric; } static getAvailableMetrics() { return Array.from(this.metrics.keys()); } static getMetricInfo(name) { const metric = this.getMetric(name); return { name: metric.getName(), description: metric.getDescription() }; } } exports.MetricFactory = MetricFactory; MetricFactory.metrics = new Map(); //# sourceMappingURL=base-metric.js.map