struct Gemini::GenerateContentResponse::UsageMetadata
- Gemini::GenerateContentResponse::UsageMetadata
- Struct
- Value
- Object
Overview
Metadata on the generation request's token usage.
Included Modules
- JSON::Serializable
Defined in:
gemini/response.crConstructors
Instance Method Summary
-
#cached_content_token_count : Int32 | Nil
Number of tokens in the cached part of the prompt (the cached content)
-
#candidates_token_count : Int32 | Nil
Total number of tokens across all the generated response candidates.
-
#prompt_token_count : Int32
Number of tokens in the prompt.
-
#total_token_count : Int32
Total token count for the generation request (prompt + response candidates).
Constructor Detail
Instance Method Detail
def cached_content_token_count : Int32 | Nil
#
Number of tokens in the cached part of the prompt (the cached content)
def candidates_token_count : Int32 | Nil
#
Total number of tokens across all the generated response candidates.
def prompt_token_count : Int32
#
Number of tokens in the prompt. When cachedContent is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.
def total_token_count : Int32
#
Total token count for the generation request (prompt + response candidates).