Class: OpenAI::Models::Beta::BetaResponseInputTextContent

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

Defined Under Namespace

Classes: PromptCacheBreakpoint

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(text:, prompt_cache_breakpoint: nil, type: :input_text) ⇒ BetaResponseInputTextContent

Returns a new instance of BetaResponseInputTextContent.

Parameters:

  • text —

    The text input to the model.

  • 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_text) —

    The type of the input item. Always input_text.

  • text: (String)
  • prompt_cache_breakpoint: (OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint, nil) (defaults to: nil)
  • type: (:input_text) (defaults to: :input_text)


# File 'lib/openai/models/beta/beta_response_input_text_content.rb', line 31


Instance Attribute Details

#prompt_cache_breakpoint ⇒ OpenAI::Beta::BetaResponseInputTextContent::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::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint, nil)


25
26
27
28
29
# File 'lib/openai/models/beta/beta_response_input_text_content.rb', line 25

optional(
  :prompt_cache_breakpoint,
  -> { OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint },
  nil?: true
)

#text ⇒ String

The text input to the model.

Returns:

  • (String)


11
# File 'lib/openai/models/beta/beta_response_input_text_content.rb', line 11

required :text, String

#type ⇒ :input_text

The type of the input item. Always input_text.

Returns:

  • (:input_text)


17
# File 'lib/openai/models/beta/beta_response_input_text_content.rb', line 17

required :type, const: :input_text

Instance Method Details

#to_hash ⇒ { text: String, ?type: :input_text, ?prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint? }

Returns:

  • ({ text: String, ?type: :input_text, ?prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint? })


39
40
41
42
43
# File 'sig/openai/models/beta/beta_response_input_text_content.rbs', line 39

def to_hash: -> {
  text: String,
  ?type: :input_text,
  ?prompt_cache_breakpoint: OpenAI::Beta::BetaResponseInputTextContent::PromptCacheBreakpoint?
}