langchain.js
    Preparing search index...

    Class BaseCache<T>Abstract

    Base class for all caches. All caches should extend this class.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    keyEncoder: HashKeyEncoder = defaultHashKeyEncoder

    Methods

    • Parameters

      • prompt: string
      • llmKey: string

      Returns Promise<null | T>

    • Sets a custom key encoder function for the cache. This function should take a prompt and an LLM key and return a string that will be used as the cache key.

      Parameters

      Returns void

    • Parameters

      • prompt: string
      • llmKey: string
      • value: T

      Returns Promise<void>