LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
Pythonlangsmithprompt_cacheCacheMetrics
Class●Since v0.7

CacheMetrics

Cache performance metrics.

Copy
CacheMetrics(
  self,
  hits: int = 0,
  misses: int = 0,
  refreshes: int = 0,
  refresh_errors: int = 0
)

Constructors

constructor
__init__
NameType
hitsint
missesint
refreshesint
refresh_errorsint

Attributes

attribute
hits: int
attribute
misses: int
attribute
refreshes: int
attribute
refresh_errors: int
attribute
total_requests: int

Total cache requests (hits + misses).

attribute
hit_rate: float

Cache hit rate (0.0 to 1.0).

View source on GitHub