struct AI::Google::UsageMetadata

Overview

Google Generative AI usage metadata from the API response.

Included Modules

Defined in:

ai/google/convert_usage.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(prompt_token_count : Int32 | Nil = nil, candidates_token_count : Int32 | Nil = nil, total_token_count : Int32 | Nil = nil, cached_content_token_count : Int32 | Nil = nil, thoughts_token_count : Int32 | Nil = nil, traffic_type : String | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def cached_content_token_count : Int32 | Nil #

[View source]
def candidates_token_count : Int32 | Nil #

[View source]
def prompt_token_count : Int32 | Nil #

[View source]
def thoughts_token_count : Int32 | Nil #

[View source]
def total_token_count : Int32 | Nil #

[View source]
def traffic_type : String | Nil #

[View source]