MongoDB Atlas cache
A cache that uses MongoDB Atlas as a backend
Name of collection for cache to live. Defaults to "default".
Connection URI to MongoDB Atlas. Defaults to "default".
Name of database for cache to live. Defaults to "default".
Returns the database used to store cache values.
Returns the collection used to store cache values.
Close the MongoClient used by the MongoDBCache.
Look up based on prompt and llm_string.
Update cache based on prompt and llm_string.
Clear cache that can take additional keyword arguments. Any additional arguments will propagate as filtration criteria for what gets deleted.
E.g. # Delete only entries that have llm_string as "fake-model" self.clear(llm_string="fake-model")