Class: OpenAI::Models::Image

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

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(b64_json: nil, revised_prompt: nil, url: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Image for more details.

Represents the content or the URL of an image generated by the OpenAI API.

Parameters:

  • b64_json (String) (defaults to: nil)

    The base64-encoded JSON of the generated image. Default value for ‘gpt-image-1`,

  • revised_prompt (String) (defaults to: nil)

    For ‘dall-e-3` only, the revised prompt that was used to generate the image.

  • url (String) (defaults to: nil)

    When using ‘dall-e-2` or `dall-e-3`, the URL of the generated image if `response



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

Instance Attribute Details

#b64_jsonString?

The base64-encoded JSON of the generated image. Default value for ‘gpt-image-1`, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`.

Returns:

  • (String, nil)


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

optional :b64_json, String

#revised_promptString?

For ‘dall-e-3` only, the revised prompt that was used to generate the image.

Returns:

  • (String, nil)


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

optional :revised_prompt, String

#urlString?

When using ‘dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for `gpt-image-1`.

Returns:

  • (String, nil)


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

optional :url, String