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

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

Overview

See Also:

Defined Under Namespace

Classes: InputTokensDetails

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, 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(input_tokens: , input_tokens_details: , output_tokens: , total_tokens: ) ⇒ Object

For ‘gpt-image-1` only, the token usage information for the image generation.

Parameters:

  • input_tokens (Integer) (defaults to: )

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

  • input_tokens_details (OpenAI::Models::ImagesResponse::Usage::InputTokensDetails) (defaults to: )

    The input tokens detailed information for the image generation.

  • output_tokens (Integer) (defaults to: )

    The number of image tokens in the output image.

  • total_tokens (Integer) (defaults to: )

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



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

Instance Attribute Details

#input_tokensInteger

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

Returns:

  • (Integer)


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

required :input_tokens, Integer

#input_tokens_detailsOpenAI::Models::ImagesResponse::Usage::InputTokensDetails

The input tokens detailed information for the image generation.



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

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

#output_tokensInteger

The number of image tokens in the output image.

Returns:

  • (Integer)


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

required :output_tokens, Integer

#total_tokensInteger

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

Returns:

  • (Integer)


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

required :total_tokens, Integer