Retrieves data from the cache. It constructs a cache key from the given
prompt
and llmKey
, and retrieves the corresponding value from the
Cloudflare KV namespace.
The prompt used to construct the cache key.
The LLM key used to construct the cache key.
An array of Generations if found, null otherwise.
Updates the cache with new data. It constructs a cache key from the
given prompt
and llmKey
, and stores the value
in the Cloudflare KV
namespace.
The prompt used to construct the cache key.
The LLM key used to construct the cache key.
The value to be stored in the cache.
Generated using TypeDoc
⚠️ Deprecated ⚠️
Install and import from "@langchain/cloudflare" instead.
This feature is deprecated and will be removed in the future.
It is not recommended for use.
Represents a specific implementation of a caching mechanism using Cloudflare KV as the underlying storage system. It extends the
BaseCache
class and overrides its methods to provide the Cloudflare KV-specific logic.Example