Base class for all caches. All caches should extend this class.

Type Parameters

Hierarchy (view full)

Constructors

Properties

keyEncoder: HashKeyEncoder = getCacheKey

Methods

  • Sets a custom key encoder function for the cache. This function should take a prompt and an LLM key and return a string that will be used as the cache key.

    Parameters

    Returns void