Class AnthropicCacheDiagnostics
AnthropicChatResponseMetadata.cacheDiagnostics().
Cache diagnostics compares the current request against the one identified by
previousMessageId (set via AnthropicChatRequestParameters.Builder.previousMessageId(String))
and reports the first point where the two diverged, so that an unexpected prompt-cache miss
(e.g. usage.cacheReadInputTokens dropping to zero) can be diagnosed instead of guessed at.
Requires AnthropicChatRequestParameters.Builder.returnCacheDiagnostics(Boolean) to be enabled.
AnthropicChatResponseMetadata.cacheDiagnostics() itself is null when diagnostics
were not requested, or when a comparison ran and found no divergence. When this object is present,
cacheMissReasonType() is null while the comparison is still running (treat this as
inconclusive and check the next turn), otherwise it is one of: "model_changed",
"system_changed", "tools_changed", "messages_changed",
"previous_message_not_found", or "unavailable".
See the cache diagnostics docs.
- Since:
- 1.10.0
-
Method Details
-
cacheMissReasonType
The cache-miss reason discriminator, ornullwhile the comparison is still running. -
cacheMissedInputTokens
An estimate of how many input tokens fell after the divergence point. Only populated for the"*_changed"reason types;nullotherwise. -
equals
-
hashCode
-
toString
-
builder
-