Skip to main content
Version: 0.1.22
Last Verified: 2025-01-27
Package: @hopx-ai/sdk on npm

Overview

The Cache resource provides methods for managing the execution result cache in sandboxes.

Methods

stats

Get cache statistics.
async cache.stats(): Promise<CacheStatsResponse>
Returns: Promise<CacheStatsResponse> - Cache statistics Example:
const stats = await sandbox.cache.stats();
console.log(`Cache hits: ${stats.cache.totalHits}`);
console.log(`Cache size: ${stats.cache.size} / ${stats.cache.maxSize}`);

clear

Clear the execution result cache.
async cache.clear(): Promise<CacheClearResponse>
This clears all cached execution results.

See Also

Next Steps