LLMCache constructor

LLMCache({
  1. int maxEntries = _defaultMaxEntries,
  2. Duration ttl = _defaultTtl,
  3. String? persistPath,
})

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();
}