Class: OpenAI::Models::ImagesResponse::Usage

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/images_response.rb,
sig/openai/models/images_response.rbs

Overview

See Also:

  • OpenAI::Models::ImagesResponse#usage

Defined Under Namespace

Classes: InputTokensDetails, OutputTokensDetails

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(image_tokens:, text_tokens:) ⇒ Object

Parameters:

  • input_tokens —

    The number of tokens (images and text) in the input prompt.

  • input_tokens_details —

    The input tokens detailed information for the image generation.

  • output_tokens —

    The number of output tokens generated by the model.

  • total_tokens —

    The total number of tokens (images and text) used for the image generation.

  • output_tokens_details —

    The output token details for the image generation.



# File 'lib/openai/models/images_response.rb', line 190

Instance Attribute Details

#input_tokens ⇒ Integer

The number of tokens (images and text) in the input prompt.

Returns:

  • (Integer)


164
# File 'lib/openai/models/images_response.rb', line 164

required :input_tokens, Integer

#input_tokens_details ⇒ OpenAI::ImagesResponse::Usage::InputTokensDetails

The input tokens detailed information for the image generation.

Returns:

  • (OpenAI::ImagesResponse::Usage::InputTokensDetails)


170
# File 'lib/openai/models/images_response.rb', line 170

required :input_tokens_details, -> { OpenAI::ImagesResponse::Usage::InputTokensDetails }

#output_tokens ⇒ Integer

The number of output tokens generated by the model.

Returns:

  • (Integer)


176
# File 'lib/openai/models/images_response.rb', line 176

required :output_tokens, Integer

#output_tokens_details ⇒ OpenAI::ImagesResponse::Usage::OutputTokensDetails?

The output token details for the image generation.

Returns:

  • (OpenAI::ImagesResponse::Usage::OutputTokensDetails, nil)


188
# File 'lib/openai/models/images_response.rb', line 188

optional :output_tokens_details, -> { OpenAI::ImagesResponse::Usage::OutputTokensDetails }

#total_tokens ⇒ Integer

The total number of tokens (images and text) used for the image generation.

Returns:

  • (Integer)


182
# File 'lib/openai/models/images_response.rb', line 182

required :total_tokens, Integer

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


205
# File 'sig/openai/models/images_response.rbs', line 205

def to_hash: -> {