UNPKG

dspy.ts

Version:

DSPy.ts - Declarative Self-Learning TypeScript: A framework for compositional LM pipelines with self-improving prompt strategies.

30 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DummyLM = exports.LMError = void 0; exports.configureLM = configureLM; exports.getLM = getLM; const base_1 = require("./lm/base"); // Global variable to hold the LM driver let globalLM = null; /** * Configure the global language model driver */ function configureLM(lm) { globalLM = lm; } /** * Get the currently configured LM driver * @throws {LMError} if no LM is configured */ function getLM() { if (!globalLM) { throw new base_1.LMError('No language model configured. Call configureLM() first.'); } return globalLM; } // Export LM-related types and implementations var base_2 = require("./lm/base"); Object.defineProperty(exports, "LMError", { enumerable: true, get: function () { return base_2.LMError; } }); var dummy_1 = require("./lm/dummy"); Object.defineProperty(exports, "DummyLM", { enumerable: true, get: function () { return dummy_1.DummyLM; } }); //# sourceMappingURL=index.js.map