Class: OpenAI::Models::Image

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

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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(b64_json: nil, revised_prompt: nil, url: nil) ⇒ Image

Returns a new instance of Image.

Parameters:

  • b64_json (defaults to: nil) —

    The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when response_format is set to b64_json for models that support that parameter.

  • revised_prompt (defaults to: nil) —

    The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models.

  • url (defaults to: nil) —

    The URL of the generated image when response_format is set to url for models that support that parameter. Unsupported for GPT image models.

  • b64_json: (String) (defaults to: nil)
  • revised_prompt: (String) (defaults to: nil)
  • url: (String) (defaults to: nil)


# File 'lib/openai/models/image.rb', line 28

Instance Attribute Details

#b64_json ⇒ String?

The base64-encoded JSON of the generated image. Returned by default for GPT image models, or when response_format is set to b64_json for models that support that parameter.

Returns:

  • (String, nil)


12
# File 'lib/openai/models/image.rb', line 12

optional :b64_json, String

#revised_prompt ⇒ String?

The revised prompt used to generate the image, for models that support prompt revision. Not returned by GPT image models.

Returns:

  • (String, nil)


19
# File 'lib/openai/models/image.rb', line 19

optional :revised_prompt, String

#url ⇒ String?

The URL of the generated image when response_format is set to url for models that support that parameter. Unsupported for GPT image models.

Returns:

  • (String, nil)


26
# File 'lib/openai/models/image.rb', line 26

optional :url, String

Instance Method Details

#to_hash ⇒ { ?:b64_json => String, ?revised_prompt: String, ?url: String }

Returns:

  • ({ ?:b64_json => String, ?revised_prompt: String, ?url: String })


48
49
50
51
52
# File 'sig/openai/models/image.rbs', line 48

def to_hash: -> {
  ?:b64_json => String,
  ?revised_prompt: String,
  ?url: String
}