Class: OpenAI::Models::ImageEditCompletedEvent

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

Defined Under Namespace

Modules: Background, OutputFormat, Quality, Size Classes: Usage

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:, quality:, size:, usage:, safety_identifier: nil, type: :"image_edit.completed") ⇒ ImageEditCompletedEvent

Returns a new instance of ImageEditCompletedEvent.

Parameters:

  • b64_json —

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

  • background —

    The background setting for the edited image.

  • created_at —

    The Unix timestamp when the event was created.

  • output_format —

    The output format for the edited image.

  • quality —

    The quality setting for the edited image.

  • size —

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

  • usage —

    For the GPT image models only, the token usage information for the image generation.

  • safety_identifier (defaults to: nil) —

    The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.

  • type (defaults to: :"image_edit.completed") —

    The type of the event. Always image_edit.completed.

  • b64_json: (String)
  • background: (OpenAI::Models::ImageEditCompletedEvent::background)
  • created_at: (Integer)
  • output_format: (OpenAI::Models::ImageEditCompletedEvent::output_format)
  • quality: (OpenAI::Models::ImageEditCompletedEvent::quality)
  • size: (OpenAI::Models::ImageEditCompletedEvent::size)
  • usage: (OpenAI::ImageEditCompletedEvent::Usage)
  • safety_identifier: (String, nil) (defaults to: nil)
  • type: (:"image_edit.completed") (defaults to: :"image_edit.completed")


# File 'lib/openai/models/image_edit_completed_event.rb', line 63

Instance Attribute Details

#b64_json ⇒ String

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

Returns:

  • (String)


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

required :b64_json, String

#background ⇒ OpenAI::Models::ImageEditCompletedEvent::background

The background setting for the edited image.

Returns:

  • (OpenAI::Models::ImageEditCompletedEvent::background)


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

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

#created_at ⇒ Integer

The Unix timestamp when the event was created.

Returns:

  • (Integer)


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

required :created_at, Integer

#output_format ⇒ OpenAI::Models::ImageEditCompletedEvent::output_format

The output format for the edited image.

Returns:

  • (OpenAI::Models::ImageEditCompletedEvent::output_format)


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

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

#quality ⇒ OpenAI::Models::ImageEditCompletedEvent::quality

The quality setting for the edited image.

Returns:

  • (OpenAI::Models::ImageEditCompletedEvent::quality)


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

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

#safety_identifier ⇒ String?

The effective safety identifier used for safety monitoring and abuse detection. This is the non-empty safety_identifier from the request, or the deprecated user value when safety_identifier is omitted, null, or empty.

Returns:

  • (String, nil)


61
# File 'lib/openai/models/image_edit_completed_event.rb', line 61

optional :safety_identifier, String, nil?: true

#size ⇒ String

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

Returns:

  • (String)


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

required :size, String

#type ⇒ :"image_edit.completed"

The type of the event. Always image_edit.completed.

Returns:

  • (:"image_edit.completed")


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

required :type, const: :"image_edit.completed"

#usage ⇒ OpenAI::ImageEditCompletedEvent::Usage

For the GPT image models only, the token usage information for the image generation.

Returns:

  • (OpenAI::ImageEditCompletedEvent::Usage)


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

required :usage, -> { OpenAI::ImageEditCompletedEvent::Usage }

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/image_edit_completed_event.rb', line 106

Instance Method Details

#to_hash ⇒ { :b64_json => String, background: OpenAI::Models::ImageEditCompletedEvent::background, created_at: Integer, output_format: OpenAI::Models::ImageEditCompletedEvent::output_format, quality: OpenAI::Models::ImageEditCompletedEvent::quality, size: OpenAI::Models::ImageEditCompletedEvent::size, ?type: :"image_edit.completed", usage: OpenAI::ImageEditCompletedEvent::Usage, ?safety_identifier: String? }

Returns:

  • ({ :b64_json => String, background: OpenAI::Models::ImageEditCompletedEvent::background, created_at: Integer, output_format: OpenAI::Models::ImageEditCompletedEvent::output_format, quality: OpenAI::Models::ImageEditCompletedEvent::quality, size: OpenAI::Models::ImageEditCompletedEvent::size, ?type: :"image_edit.completed", usage: OpenAI::ImageEditCompletedEvent::Usage, ?safety_identifier: String? })


85
86
87
88
89
90
91
92
93
94
95
# File 'sig/openai/models/image_edit_completed_event.rbs', line 85

def to_hash: -> {
  :b64_json => String,
  background: OpenAI::Models::ImageEditCompletedEvent::background,
  created_at: Integer,
  output_format: OpenAI::Models::ImageEditCompletedEvent::output_format,
  quality: OpenAI::Models::ImageEditCompletedEvent::quality,
  size: OpenAI::Models::ImageEditCompletedEvent::size,
  ?type: :"image_edit.completed",
  usage: OpenAI::ImageEditCompletedEvent::Usage,
  ?safety_identifier: String?
}