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

Overview

Defined Under Namespace

Modules: Model, ResponseFormat, Size

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

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

==, #==, #[], 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(image: , model: nil, n: nil, response_format: nil, size: nil, user: nil, request_options: {}) ⇒ Object

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

Parameters:

  • image (Pathname, StringIO, IO, String, OpenAI::FilePart) (defaults to: )

    The image to use as the basis for the variation(s). Must be a valid PNG file, le

  • model (String, Symbol, OpenAI::Models::ImageModel, nil) (defaults to: nil)

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

  • n (Integer, nil) (defaults to: nil)

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

  • response_format (Symbol, OpenAI::Models::ImageCreateVariationParams::ResponseFormat, nil) (defaults to: nil)

    The format in which the generated images are returned. Must be one of ‘url` or `

  • size (Symbol, OpenAI::Models::ImageCreateVariationParams::Size, nil) (defaults to: nil)

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

  • user (String) (defaults to: nil)

    A unique identifier representing your end-user, which can help OpenAI to monitor

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


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

Instance Attribute Details

#imagePathname, ...

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

Returns:



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

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

#modelString, ...

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

Returns:



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

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

#nInteger?

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

Returns:

  • (Integer, nil)


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

optional :n, Integer, nil?: true

#response_formatSymbol, ...

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.



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

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

#sizeSymbol, ...

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



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

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](platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

Returns:

  • (String, nil)


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

optional :user, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

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

Returns:



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