Cache Usage Monitoring Enhancement
Overview
Previously, a TODO was marked to add a property showing how much of the cache is used. This is useful for debugging and monitoring cache usage during multi-turn conversations.
Previous State
- No easy way to check cache usage without accessing internal
last_state directly
- Users had to manually compute
state.used_cache_length / cache_length
Changes
Added Cache Usage Monitoring
Cache usage monitoring was added to both sampler classes:
Cache Usage Monitoring Enhancement
Overview
Previously, a TODO was marked to add a property showing how much of the cache is used. This is useful for debugging and monitoring cache usage during multi-turn conversations.
Previous State
last_statedirectlystate.used_cache_length / cache_lengthChanges
Added Cache Usage Monitoring
Cache usage monitoring was added to both sampler classes:
ChatSampler.cache_usageproperty(used, total)tupleNoneif no sampling has been performed yetSampler.get_cache_usage()static method — For stateless usage with the low-level API