A cache for storing LLM generations that stores data in memory.
class InMemoryCacheBaseCache<T>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.
Returns a global instance of InMemoryCache using a predefined global map as the initial cache.