Optional
map: Map<string, T>Retrieves data from the cache using a prompt and an LLM key. If the data is not found, it returns null.
The prompt used to find the data.
The LLM key used to find the data.
The data corresponding to the prompt and LLM key, or null if not found.
Updates the cache with new data using a prompt and an LLM key.
The prompt used to store the data.
The LLM key used to store the data.
The data to be stored.
Static
globalReturns a global instance of InMemoryCache using a predefined global map as the initial cache.
A global instance of InMemoryCache.
A cache for storing LLM generations that stores data in memory.