Class: OpenAI::Models::Responses::ResponseInputImage

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

Defined Under Namespace

Modules: Detail Classes: PromptCacheBreakpoint

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(detail:, file_id: nil, image_url: nil, prompt_cache_breakpoint: nil, type: :input_image) ⇒ ResponseInputImage

Returns a new instance of ResponseInputImage.

Parameters:

  • detail —

    The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.

  • file_id (defaults to: nil) —

    The ID of the file to be sent to the model.

  • image_url (defaults to: nil) —

    The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

  • prompt_cache_breakpoint (defaults to: nil) —

    Marks the exact end of a reusable prompt prefix. When ttl is omitted, the breakpoint inherits the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.

  • type (defaults to: :input_image) —

    The type of the input item. Always input_image.

  • detail: (OpenAI::Models::Responses::ResponseInputImage::detail)
  • file_id: (String, nil) (defaults to: nil)
  • image_url: (String, nil) (defaults to: nil)
  • prompt_cache_breakpoint: (OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint) (defaults to: nil)
  • type: (:input_image) (defaults to: :input_image)


# File 'lib/openai/models/responses/response_input_image.rb', line 41


Instance Attribute Details

#detail ⇒ OpenAI::Models::Responses::ResponseInputImage::detail

The detail level of the image to be sent to the model. One of high, low, auto, or original. Defaults to auto.

Returns:

  • (OpenAI::Models::Responses::ResponseInputImage::detail)


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

required :detail, enum: -> { OpenAI::Responses::ResponseInputImage::Detail }

#file_id ⇒ String?

The ID of the file to be sent to the model.

Returns:

  • (String, nil)


24
# File 'lib/openai/models/responses/response_input_image.rb', line 24

optional :file_id, String, nil?: true

#image_url ⇒ String?

The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL.

Returns:

  • (String, nil)


31
# File 'lib/openai/models/responses/response_input_image.rb', line 31

optional :image_url, String, nil?: true

#prompt_cache_breakpoint ⇒ OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint?

Marks the exact end of a reusable prompt prefix. When ttl is omitted, the breakpoint inherits the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.

Returns:

  • (OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint, nil)


39
# File 'lib/openai/models/responses/response_input_image.rb', line 39

optional :prompt_cache_breakpoint, -> { OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint }

#type ⇒ :input_image

The type of the input item. Always input_image.

Returns:

  • (:input_image)


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

required :type, const: :input_image

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/responses/response_input_image.rb', line 76


Instance Method Details

#to_hash ⇒ { detail: OpenAI::Models::Responses::ResponseInputImage::detail, ?type: :input_image, ?file_id: String?, ?image_url: String?, ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint }

Returns:

  • ({ detail: OpenAI::Models::Responses::ResponseInputImage::detail, ?type: :input_image, ?file_id: String?, ?image_url: String?, ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint })


62
63
64
65
66
67
68
# File 'sig/openai/models/responses/response_input_image.rbs', line 62

def to_hash: -> {
  detail: OpenAI::Models::Responses::ResponseInputImage::detail,
  ?type: :input_image,
  ?file_id: String?,
  ?image_url: String?,
  ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputImage::PromptCacheBreakpoint
}