Class: OpenAI::Models::Responses::ResponsePrompt

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

Defined Under Namespace

Modules: Variable

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_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(id:, variables: nil, version: nil) ⇒ Object

Parameters:

  • id —

    The unique identifier of the prompt template to use.

  • variables (defaults to: nil) —

    Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.

  • version (defaults to: nil) —

    Optional version of the prompt template.



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

Instance Attribute Details

#id ⇒ String

The unique identifier of the prompt template to use.

Returns:

  • (String)


11
# File 'lib/openai/models/responses/response_prompt.rb', line 11

required :id, String

#variables ⇒ ::Hash[Symbol, OpenAI::Models::Responses::ResponsePrompt::variable]?

Optional map of values to substitute in for variables in your prompt. The substitution values can either be strings, or other Response input types like images or files.

Returns:

  • (::Hash[Symbol, OpenAI::Models::Responses::ResponsePrompt::variable], nil)


19
20
21
22
23
# File 'lib/openai/models/responses/response_prompt.rb', line 19

optional(
  :variables,
  -> { OpenAI::Internal::Type::HashOf[union: OpenAI::Responses::ResponsePrompt::Variable] },
  nil?: true
)

#version ⇒ String?

Optional version of the prompt template.

Returns:

  • (String, nil)


29
# File 'lib/openai/models/responses/response_prompt.rb', line 29

optional :version, String, nil?: true

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


37
# File 'sig/openai/models/responses/response_prompt.rbs', line 37

def to_hash: -> {