Class: OpenAI::Models::Responses::ResponseInputFile

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/responses/response_input_file.rb,
sig/openai/models/responses/response_input_file.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: nil, file_data: nil, file_id: nil, file_url: nil, filename: nil, prompt_cache_breakpoint: nil, type: :input_file) ⇒ ResponseInputFile

Returns a new instance of ResponseInputFile.

Parameters:

  • detail (defaults to: nil) —

    The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.

  • file_data (defaults to: nil) —

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

  • file_id (defaults to: nil) —

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

  • file_url (defaults to: nil) —

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

  • filename (defaults to: nil) —

    The name of the file to be sent 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_file) —

    The type of the input item. Always input_file.

  • detail: (OpenAI::Models::Responses::ResponseInputFile::detail) (defaults to: nil)
  • file_data: (String) (defaults to: nil)
  • file_id: (String, nil) (defaults to: nil)
  • file_url: (String) (defaults to: nil)
  • filename: (String) (defaults to: nil)
  • prompt_cache_breakpoint: (OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint) (defaults to: nil)
  • type: (:input_file) (defaults to: :input_file)


# File 'lib/openai/models/responses/response_input_file.rb', line 55

Instance Attribute Details

#detail ⇒ OpenAI::Models::Responses::ResponseInputFile::detail?

The detail level of the file to be sent to the model. Use auto to let the system select the detail level; for GPT-5.6 and later models, auto uses high-quality rendering, which may increase input token usage. Use low for lower-cost rendering, or high to render the file at higher quality. Defaults to auto.

Returns:

  • (OpenAI::Models::Responses::ResponseInputFile::detail, nil)


21
# File 'lib/openai/models/responses/response_input_file.rb', line 21

optional :detail, enum: -> { OpenAI::Responses::ResponseInputFile::Detail }

#file_data ⇒ String?

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

Returns:

  • (String, nil)


27
# File 'lib/openai/models/responses/response_input_file.rb', line 27

optional :file_data, String

#file_id ⇒ String?

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

Returns:

  • (String, nil)


33
# File 'lib/openai/models/responses/response_input_file.rb', line 33

optional :file_id, String, nil?: true

#file_url ⇒ String?

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

Returns:

  • (String, nil)


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

optional :file_url, String

#filename ⇒ String?

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

Returns:

  • (String, nil)


45
# File 'lib/openai/models/responses/response_input_file.rb', line 45

optional :filename, String

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


53
# File 'lib/openai/models/responses/response_input_file.rb', line 53

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

#type ⇒ :input_file

The type of the input item. Always input_file.

Returns:

  • (:input_file)


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

required :type, const: :input_file

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/responses/response_input_file.rb', line 99

Instance Method Details

#to_hash ⇒ { ?type: :input_file, ?detail: OpenAI::Models::Responses::ResponseInputFile::detail, ?file_data: String, ?file_id: String?, ?file_url: String, ?filename: String, ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint }

Returns:

  • ({ ?type: :input_file, ?detail: OpenAI::Models::Responses::ResponseInputFile::detail, ?file_data: String, ?file_id: String?, ?file_url: String, ?filename: String, ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint })


98
99
100
101
102
103
104
105
106
# File 'sig/openai/models/responses/response_input_file.rbs', line 98

def to_hash: -> {
  ?type: :input_file,
  ?detail: OpenAI::Models::Responses::ResponseInputFile::detail,
  ?file_data: String,
  ?file_id: String?,
  ?file_url: String,
  ?filename: String,
  ?prompt_cache_breakpoint: OpenAI::Responses::ResponseInputFile::PromptCacheBreakpoint
}