Test suite for checking the BaseCache API of a caching layer for LLMs.
Verifies the basic caching API of a caching layer for LLMs.
The test suite is designed for synchronous caching layers.
Implementers should subclass this test suite and provide a fixture that returns an empty cache for each test.
AsyncCacheTestSuite()Get the cache class to test.
The returned cache should be EMPTY.
Return a sample prompt for testing.
Return a sample LLM string for testing.
Return a sample Generation object for testing.
Test that the cache is empty.
Test updating the cache.
Test that the cache is still empty.
This test should follow a test that updates the cache.
This just verifies that the fixture is set up properly to be empty after each test.
Test clearing the cache.
Test cache miss.
Test cache hit.
Test updating the cache with multiple Generation objects.