LLMCache constructor
Creates a new LLM cache.
maxEntries - Maximum number of entries to keep in cache (LRU eviction).
ttl - Time-to-live for cache entries.
persistPath - Optional path to persist cache to disk.
Implementation
LLMCache({
this.maxEntries = _defaultMaxEntries,
this.ttl = _defaultTtl,
String? persistPath,
}) : _persistFile = persistPath != null ? File(persistPath) : null {
_loadFromDisk();
}