AccuralAI Cache Disk

Disk-backed cache powered by SQLite.

class accuralai_cache.disk.DiskCacheOptions(*args: Any, **kwargs: Any)[source]

Bases: CacheConfig

Configuration settings for the SQLite cache.

vacuum_on_start: bool = False
ensure_directory: bool = True
class accuralai_cache.disk.DiskCache(*, options: DiskCacheOptions | None = None)[source]

Bases: BaseCache

SQLite-backed cache storing serialized responses.

__init__(*, options: DiskCacheOptions | None = None) None[source]
async get(key: str, *, request: GenerateRequest) GenerateResponse | None[source]
async set(key: str, value: GenerateResponse, *, ttl_s: int | None = None) None[source]
async invalidate(key: str) None[source]
async invalidate_prefix(prefix: str) None[source]

Optional hook for derived caches; default routes to individual invalidation.

async accuralai_cache.disk.build_disk_cache(*, config: Mapping[str, Any] | Any | None = None, **_: Any) DiskCache[source]

Factory for the SQLite-backed disk cache.