Class: OpenAI::Models::Chat::ChatCompletionContentPartImage

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

Defined Under Namespace

Classes: ImageURL, 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_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, 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:, prompt_cache_breakpoint: nil, type: :image_url) ⇒ Object

Parameters:

  • 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.

  • type (defaults to: :image_url) —

    The type of the content part.



# File 'lib/openai/models/chat/chat_completion_content_part_image.rb', line 29

Instance Attribute Details

#image_url ⇒ OpenAI::Models::Chat::ChatCompletionContentPartImage::ImageURL

Parameters:

  • value (OpenAI::Chat::ChatCompletionContentPartImage::ImageURL)

Returns:



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

required :image_url, -> { OpenAI::Chat::ChatCompletionContentPartImage::ImageURL }

#prompt_cache_breakpoint ⇒ OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint?

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.

Returns:

  • (OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint, nil)


24
25
26
27
# File 'lib/openai/models/chat/chat_completion_content_part_image.rb', line 24

optional(
  :prompt_cache_breakpoint,
  -> { OpenAI::Chat::ChatCompletionContentPartImage::PromptCacheBreakpoint }
)

#type ⇒ :image_url

The type of the content part.

Returns:

  • (:image_url)


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

required :type, const: :image_url

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/chat/chat_completion_content_part_image.rb', line 77

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


43
# File 'sig/openai/models/chat/chat_completion_content_part_image.rbs', line 43

def to_hash: -> {