mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-03 20:16:52 +00:00
docs: document Anthropic cache TTL count details (#31708)
This commit is contained in:
@@ -568,6 +568,26 @@
|
||||
" ```\n",
|
||||
" and specifying `\"cache_control\": {\"type\": \"ephemeral\", \"ttl\": \"1h\"}`.\n",
|
||||
"\n",
|
||||
" Details of cached token counts will be included on the `InputTokenDetails` of response's `usage_metadata`:\n",
|
||||
"\n",
|
||||
" ```python\n",
|
||||
" response = llm.invoke(messages)\n",
|
||||
" response.usage_metadata\n",
|
||||
" ```\n",
|
||||
" ```\n",
|
||||
" {\n",
|
||||
" \"input_tokens\": 1500,\n",
|
||||
" \"output_tokens\": 200,\n",
|
||||
" \"total_tokens\": 1700,\n",
|
||||
" \"input_token_details\": {\n",
|
||||
" \"cache_read\": 0,\n",
|
||||
" \"cache_creation\": 1000,\n",
|
||||
" \"ephemeral_1h_input_tokens\": 750,\n",
|
||||
" \"ephemeral_5m_input_tokens\": 250,\n",
|
||||
" }\n",
|
||||
" }\n",
|
||||
" ```\n",
|
||||
"\n",
|
||||
":::"
|
||||
]
|
||||
},
|
||||
|
Reference in New Issue
Block a user