Module Values.TokenUsageSource

The tokens used in a message API inference call.

Sourcetype nonrec t = {
  1. inputTokens : TokenUsageInputTokensInteger.t option;
    (*

    The number of tokens sent in the request to the model.

    *)
  2. outputTokens : TokenUsageOutputTokensInteger.t option;
    (*

    The number of tokens that the model generated for the request.

    *)
  3. totalTokens : TokenUsageTotalTokensInteger.t option;
    (*

    The total of input tokens and tokens generated by the model.

    *)
  4. cacheReadInputTokens : TokenUsageCacheReadInputTokensInteger.t option;
    (*

    The number of input tokens read from the cache for the request.

    *)
  5. cacheWriteInputTokens : TokenUsageCacheWriteInputTokensInteger.t option;
    (*

    The number of input tokens written to the cache for the request.

    *)
  6. cacheDetails : CacheDetailsList.t option;
    (*

    Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).

    *)
}
Sourceval make : ?inputTokens:??? -> ?outputTokens:??? -> ?totalTokens:??? -> ?cacheReadInputTokens:??? -> ?cacheWriteInputTokens:??? -> ?cacheDetails:??? -> unit -> t
Sourceval to_value : t -> [> `Structure of (string * [> `Integer of TokenUsageInputTokensInteger.t | `List of [> `Structure of (string * [> `Enum of string | `Integer of CacheDetailInputTokensInteger.t ]) list ] list ]) list ]
Sourceval to_query : t -> Awso.Client.Query.t
Sourceval of_xml : Awso.Xml.t -> t
Sourceval of_string : string -> t
Sourceval of_json : Yojson.Safe.t -> t
Sourceval to_json : t -> Yojson.Safe.t