Lookup LLM generations in cache by prompt and associated LLM key.
The prompt to lookup.
The LLM key to lookup.
The generations associated with the prompt and LLM key, or null if not found.
Update the cache with the given generations.
Note this overwrites any existing generations for the given prompt and LLM key.
The prompt to update.
The LLM key to update.
The generations to store.
Static
fromCreate a new standard cache backed by Momento.
The settings to instantiate the cache.
The settings to instantiate the Momento standard cache.
The name of the cache to use to store the data.
The Momento cache client.
Optional
ensureCacheExists?: trueIf true, ensure that the cache exists before returning. If false, the cache is not checked for existence. Defaults to true.
Optional
ttlSeconds?: numberThe time to live for the cache items. If not specified, the cache client default is used.
The Momento-backed cache.
A cache that uses Momento as the backing store. See https://gomomento.com.
Example