Usage

@Serializable
class Usage(val completionTokens: Int, val promptTokens: Int, val promptCacheHitTokens: Int? = null, val promptCacheMissTokens: Int? = null, val totalTokens: Int, val completionTokensDetails: CompletionTokenDetails? = null)

Constructors

Link copied to clipboard
constructor(completionTokens: Int, promptTokens: Int, promptCacheHitTokens: Int? = null, promptCacheMissTokens: Int? = null, totalTokens: Int, completionTokensDetails: CompletionTokenDetails? = null)

Properties

Link copied to clipboard

Number of tokens in the generated completion.

Link copied to clipboard

Breakdown of tokens used in a completion.

Link copied to clipboard

Number of tokens in the prompt that hits the context cache.

Link copied to clipboard

Number of tokens in the prompt that misses the context cache.

Link copied to clipboard

Number of tokens in the prompt. It equals promptCacheHitTokens + promptCacheMissTokens.

Link copied to clipboard

Total number of tokens used in the request (prompt + completion).

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String