Class: OpenAI::Models::ImageCreateVariationParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/openai/models/image_create_variation_params.rb,
sig/openai/models/image_create_variation_params.rbs

Overview

See Also:

  • OpenAI::Resources::Images#create_variation

Defined Under Namespace

Modules: Model, ResponseFormat, Size

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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:, model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) ⇒ Object

Parameters:

  • image

    The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.

    String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

  • model (defaults to: nil)

    The model to use for image generation. Only dall-e-2 is supported at this time.

  • n (defaults to: nil)

    The number of images to generate. Must be between 1 and 10.

  • response_format (defaults to: nil)

    The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

  • size (defaults to: nil)

    The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

  • user (defaults to: nil)

    A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.



# File 'lib/openai/models/image_create_variation_params.rb', line 57

Instance Attribute Details

#imageOpenAI::Internal::file_input

The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.

String, StringIO, and pathless IO inputs are sent with generic upload metadata. Use OpenAI::FilePart when you need to override the filename or content type.

Returns:

  • (OpenAI::Internal::file_input)


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

required :image, OpenAI::Internal::Type::FileInput

#modelOpenAI::Models::ImageCreateVariationParams::model?

The model to use for image generation. Only dall-e-2 is supported at this time.

Returns:

  • (OpenAI::Models::ImageCreateVariationParams::model, nil)


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

optional :model, union: -> { OpenAI::ImageCreateVariationParams::Model }, nil?: true

#nInteger?

The number of images to generate. Must be between 1 and 10.

Returns:

  • (Integer, nil)


32
# File 'lib/openai/models/image_create_variation_params.rb', line 32

optional :n, Integer, nil?: true

#response_formatOpenAI::Models::ImageCreateVariationParams::response_format?

The format in which the generated images are returned. Must be one of url or b64_json. URLs are only valid for 60 minutes after the image has been generated.

Returns:

  • (OpenAI::Models::ImageCreateVariationParams::response_format, nil)


40
# File 'lib/openai/models/image_create_variation_params.rb', line 40

optional :response_format, enum: -> { OpenAI::ImageCreateVariationParams::ResponseFormat }, nil?: true

#sizeOpenAI::Models::ImageCreateVariationParams::size?

The size of the generated images. Must be one of 256x256, 512x512, or 1024x1024.

Returns:

  • (OpenAI::Models::ImageCreateVariationParams::size, nil)


47
# File 'lib/openai/models/image_create_variation_params.rb', line 47

optional :size, enum: -> { OpenAI::ImageCreateVariationParams::Size }, nil?: true

#userString?

A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.

Returns:

  • (String, nil)


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

optional :user, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/image_create_variation_params.rb', line 112

.variantsArray(String, Symbol, OpenAI::Models::ImageModel)

Returns:



# File 'lib/openai/models/image_create_variation_params.rb', line 99

Instance Method Details

#to_hash{

Returns:

  • ({)


85
# File 'sig/openai/models/image_create_variation_params.rbs', line 85

def to_hash: -> {