langchain_core.caches.BaseCache¶

class langchain_core.caches.BaseCache[source]¶

Base interface for cache.

Methods

__init__()

clear(**kwargs)

Clear cache that can take additional keyword arguments.

lookup(prompt, llm_string)

Look up based on prompt and llm_string.

update(prompt, llm_string, return_val)

Update cache based on prompt and llm_string.

__init__()¶
abstract clear(**kwargs: Any) None[source]¶

Clear cache that can take additional keyword arguments.

abstract lookup(prompt: str, llm_string: str) Optional[Sequence[Generation]][source]¶

Look up based on prompt and llm_string.

abstract update(prompt: str, llm_string: str, return_val: Sequence[Generation]) None[source]¶

Update cache based on prompt and llm_string.