Class: OpenAI::Models::ImageGenPartialImageEvent

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

Defined Under Namespace

Modules: Background, OutputFormat, Quality, Size

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

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:, background:, created_at:, output_format:, partial_image_index:, quality:, size:, type: :"image_generation.partial_image") ⇒ ImageGenPartialImageEvent

Returns a new instance of ImageGenPartialImageEvent.

Parameters:

  • b64_json —

    Base64-encoded partial image data, suitable for rendering as an image.

  • background —

    The background setting for the requested image.

  • created_at —

    The Unix timestamp when the event was created.

  • output_format —

    The output format for the requested image.

  • partial_image_index —

    0-based index for the partial image (streaming).

  • quality —

    The quality setting for the requested image.

  • size —

    The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.

  • type (defaults to: :"image_generation.partial_image") —

    The type of the event. Always image_generation.partial_image.

  • b64_json: (String)
  • background: (OpenAI::Models::ImageGenPartialImageEvent::background)
  • created_at: (Integer)
  • output_format: (OpenAI::Models::ImageGenPartialImageEvent::output_format)
  • partial_image_index: (Integer)
  • quality: (OpenAI::Models::ImageGenPartialImageEvent::quality)
  • size: (OpenAI::Models::ImageGenPartialImageEvent::size)
  • type: (:"image_generation.partial_image") (defaults to: :"image_generation.partial_image")


# File 'lib/openai/models/image_gen_partial_image_event.rb', line 54

Instance Attribute Details

#b64_json ⇒ String

Base64-encoded partial image data, suitable for rendering as an image.

Returns:

  • (String)


10
# File 'lib/openai/models/image_gen_partial_image_event.rb', line 10

required :b64_json, String

#background ⇒ OpenAI::Models::ImageGenPartialImageEvent::background

The background setting for the requested image.

Returns:

  • (OpenAI::Models::ImageGenPartialImageEvent::background)


16
# File 'lib/openai/models/image_gen_partial_image_event.rb', line 16

required :background, enum: -> { OpenAI::ImageGenPartialImageEvent::Background }

#created_at ⇒ Integer

The Unix timestamp when the event was created.

Returns:

  • (Integer)


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

required :created_at, Integer

#output_format ⇒ OpenAI::Models::ImageGenPartialImageEvent::output_format

The output format for the requested image.

Returns:

  • (OpenAI::Models::ImageGenPartialImageEvent::output_format)


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

required :output_format, enum: -> { OpenAI::ImageGenPartialImageEvent::OutputFormat }

#partial_image_index ⇒ Integer

0-based index for the partial image (streaming).

Returns:

  • (Integer)


34
# File 'lib/openai/models/image_gen_partial_image_event.rb', line 34

required :partial_image_index, Integer

#quality ⇒ OpenAI::Models::ImageGenPartialImageEvent::quality

The quality setting for the requested image.

Returns:

  • (OpenAI::Models::ImageGenPartialImageEvent::quality)


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

required :quality, enum: -> { OpenAI::ImageGenPartialImageEvent::Quality }

#size ⇒ String

The image dimensions as a WIDTHxHEIGHT string, for example 1536x864.

Returns:

  • (String)


46
# File 'lib/openai/models/image_gen_partial_image_event.rb', line 46

required :size, String

#type ⇒ :"image_generation.partial_image"

The type of the event. Always image_generation.partial_image.

Returns:

  • (:"image_generation.partial_image")


52
# File 'lib/openai/models/image_gen_partial_image_event.rb', line 52

required :type, const: :"image_generation.partial_image"

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/image_gen_partial_image_event.rb', line 91

Instance Method Details

#to_hash ⇒ { :b64_json => String, background: OpenAI::Models::ImageGenPartialImageEvent::background, created_at: Integer, output_format: OpenAI::Models::ImageGenPartialImageEvent::output_format, partial_image_index: Integer, quality: OpenAI::Models::ImageGenPartialImageEvent::quality, size: OpenAI::Models::ImageGenPartialImageEvent::size, ?type: :"image_generation.partial_image" }

Returns:

  • ({ :b64_json => String, background: OpenAI::Models::ImageGenPartialImageEvent::background, created_at: Integer, output_format: OpenAI::Models::ImageGenPartialImageEvent::output_format, partial_image_index: Integer, quality: OpenAI::Models::ImageGenPartialImageEvent::quality, size: OpenAI::Models::ImageGenPartialImageEvent::size, ?type: :"image_generation.partial_image" })


72
73
74
75
76
77
78
79
80
81
# File 'sig/openai/models/image_gen_partial_image_event.rbs', line 72

def to_hash: -> {
  :b64_json => String,
  background: OpenAI::Models::ImageGenPartialImageEvent::background,
  created_at: Integer,
  output_format: OpenAI::Models::ImageGenPartialImageEvent::output_format,
  partial_image_index: Integer,
  quality: OpenAI::Models::ImageGenPartialImageEvent::quality,
  size: OpenAI::Models::ImageGenPartialImageEvent::size,
  ?type: :"image_generation.partial_image"
}