Class: OpenAI::Models::DecisionInputImage

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

Defined Under Namespace

Modules: Detail

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

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

Returns a new instance of DecisionInputImage.

Parameters:

  • image_url —

    A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.

  • detail (defaults to: nil) —

    The image detail level, using the selected model's image profile. Defaults to auto.

  • prompt_cache_breakpoint (defaults to: nil) —

    Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.

  • image_url: (String)
  • detail: (OpenAI::Models::DecisionInputImage::detail, nil) (defaults to: nil)
  • prompt_cache_breakpoint: (OpenAI::DecisionPromptCacheBreakpoint, OpenAI::Models::decision_prompt_cache_breakpoint, nil) (defaults to: nil)
  • type: (:input_image) (defaults to: :input_image)


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

Instance Attribute Details

#detail ⇒ OpenAI::Models::DecisionInputImage::detail?

The image detail level, using the selected model's image profile. Defaults to auto.

Returns:

  • (OpenAI::Models::DecisionInputImage::detail, nil)


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

optional :detail, enum: -> { OpenAI::DecisionInputImage::Detail }, nil?: true

#image_url ⇒ String

A base64-encoded image in a data URL or a publicly accessible HTTP(S) image URL.

Returns:

  • (String)


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

required :image_url, String

#prompt_cache_breakpoint ⇒ (OpenAI::DecisionPromptCacheBreakpoint

Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's prompt_cache_options.ttl; the boundary is not rounded to a token block.



30
# File 'lib/openai/models/decision_input_image.rb', line 30

optional :prompt_cache_breakpoint, -> { OpenAI::DecisionPromptCacheBreakpoint }, nil?: true

#type ⇒ Symbol, :input_image

Parameters:

  • value (:input_image)

Returns:

  • (Symbol, :input_image)


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

required :type, const: :input_image

Instance Method Details

#to_hash ⇒ { image_url: String, ?type: :input_image, ?detail: OpenAI::Models::DecisionInputImage::detail?, ?prompt_cache_breakpoint: (OpenAI::DecisionPromptCacheBreakpoint | OpenAI::Models::decision_prompt_cache_breakpoint)? }

Returns:

  • ({ image_url: String, ?type: :input_image, ?detail: OpenAI::Models::DecisionInputImage::detail?, ?prompt_cache_breakpoint: (OpenAI::DecisionPromptCacheBreakpoint | OpenAI::Models::decision_prompt_cache_breakpoint)? })


45
46
47
48
49
50
51
# File 'sig/openai/models/decision_input_image.rbs', line 45

def to_hash: -> {
  image_url: String,
  ?type: :input_image,
  ?detail: OpenAI::Models::DecisionInputImage::detail?,
  ?prompt_cache_breakpoint: (OpenAI::DecisionPromptCacheBreakpoint
  | OpenAI::Models::decision_prompt_cache_breakpoint)?
}