InputTokenDetails#

class langchain_core.messages.ai.InputTokenDetails[source]#

Breakdown of input token counts.

Does not need to sum to full input token count. Does not need to have all keys.

Example

{
    "audio": 10,
    "cache_creation": 200,
    "cache_read": 100,
}

Added in version 0.3.9.

audio: int#

Audio input tokens.

cache_creation: int#

Input tokens that were cached and there was a cache miss.

Since there was a cache miss, the cache was created from these tokens.

cache_read: int#

Input tokens that were cached and there was a cache hit.

Since there was a cache hit, the tokens were read from the cache. More precisely, the model state given these tokens was read from the cache.