UNPKG

ai-functions

Version:

Core AI primitives for building intelligent applications

34 lines 1.42 kB
/** * InMemoryEvalLogStore — Map-backed default implementation of * {@link EvalLogStore}. * * Matches Evalite v1's default backend: process-local Map keyed on `$id`, * insertion-ordered for "most recent first" listing without sorting. Suitable * for single-process tests, evals, and the cascade walker's in-flight log; * not suitable for cross-process or multi-worker setups (use a disk/SQLite * backend for those — same contract). * * @packageDocumentation */ import type { EvalLogEntry, EvalLogListOptions, EvalLogStore } from './types.js'; /** * In-memory implementation of {@link EvalLogStore}. */ export declare class InMemoryEvalLogStore implements EvalLogStore { /** * Map keyed on `$id`. Insertion order on a JS Map is preserved, so we * walk it in reverse for "most recent first" listing. */ private readonly entries; record(entry: Omit<EvalLogEntry, '$id' | 'createdAt'> & Partial<Pick<EvalLogEntry, '$id' | 'createdAt'>>): Promise<EvalLogEntry>; get(id: string): Promise<EvalLogEntry | undefined>; list(options?: EvalLogListOptions): Promise<EvalLogEntry[]>; delete(id: string): Promise<boolean>; /** * Convenience for tests: drop every entry. Not on the public * {@link EvalLogStore} interface because the disk/SQLite backends may not * want to expose a one-shot wipe. */ clear(): void; } //# sourceMappingURL=in-memory.d.ts.map