UNPKG

donobu

Version:

Create browser automations with an LLM agent and replay them as Playwright scripts.

31 lines 953 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GptConfigsPersistenceVolatile = void 0; const GptConfigNotFoundException_1 = require("../exceptions/GptConfigNotFoundException"); /** * A GPT configs "persistence" implementation that manages state using an * in-memory map. */ class GptConfigsPersistenceVolatile { constructor(data = new Map()) { this.data = data; } async set(name, config) { this.data.set(name, config); } async get(name) { const config = this.data.get(name); if (!config) { throw new GptConfigNotFoundException_1.GptConfigNotFoundException(name); } return config; } async getAll() { return this.data; } async delete(name) { this.data.delete(name); } } exports.GptConfigsPersistenceVolatile = GptConfigsPersistenceVolatile; //# sourceMappingURL=GptConfigsPersistenceVolatile.js.map