However, it is not possible to clear results after a given datetime. This would be useful when I make a mistake midway through an analysis and I want to clear only the most recent results from my cache.
Solution
Update the CacheDB class:
Add accessed_after and created_after optional arguments to the CacheDB.clear method
Issue
Currently,
CacheDB.clear
allows users to clear cached results which were accessed or created before a givendatetime
:However, it is not possible to clear results after a given
datetime
. This would be useful when I make a mistake midway through an analysis and I want to clear only the most recent results from my cache.Solution
CacheDB
class:accessed_after
andcreated_after
optional arguments to theCacheDB.clear
methodCachedGenAIModel
class (usesCacheDB
):accessed_after
andcreated_after
optional arguments to theCachedGenAIModel.clear_cache
methodDetails
Once implemented, be sure to:
test_cache_clearing