configure_global_prompt_cache(
*,
max_size: int = DEFAULT_PROMPT_CACHE_MAX_SIZE,
ttl_seconds: Optional[float| Name | Type | Description |
|---|---|---|
max_size | int | Default: DEFAULT_PROMPT_CACHE_MAX_SIZEMaximum entries in cache (LRU eviction when exceeded). |
ttl_seconds | Optional[float] | Default: DEFAULT_PROMPT_CACHE_TTL_SECONDSTime before entry is considered stale. |
refresh_interval_seconds | float | Default: DEFAULT_PROMPT_CACHE_REFRESH_INTERVAL_SECONDS |
Configure the global prompt cache.
This should be called before any cache instances are created or used.
Example:
from langsmith import configure_global_prompt_cache configure_global_prompt_cache(max_size=200, ttl_seconds=7200)
How often to check for stale entries.