@earendil-works/pi-ai
Version:
Unified LLM API with automatic model discovery and provider configuration
17 lines • 587 B
JavaScript
export class InMemoryModelsStore {
entries = new Map();
async read(providerId, options) {
options?.signal?.throwIfAborted();
const entry = this.entries.get(providerId);
return entry ? structuredClone(entry) : undefined;
}
async write(providerId, entry, options) {
options?.signal?.throwIfAborted();
this.entries.set(providerId, structuredClone(entry));
}
async delete(providerId, options) {
options?.signal?.throwIfAborted();
this.entries.delete(providerId);
}
}
//# sourceMappingURL=models-store.js.map