Class: OpenAI::Models::Chat::ChatCompletionContentPart::File

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

Defined Under Namespace

Classes: File, 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(file_data: nil, file_id: nil, filename: nil) ⇒ File

Returns a new instance of File.

Parameters:

  • prompt_cache_breakpoint —

    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 —

    The type of the content part. Always file.

  • file: (OpenAI::Chat::ChatCompletionContentPart::File::File)
  • prompt_cache_breakpoint: (OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint)
  • type: (:file)


# File 'lib/openai/models/chat/chat_completion_content_part.rb', line 47

Instance Attribute Details

#file ⇒ OpenAI::Models::Chat::ChatCompletionContentPart::File::File

Parameters:

  • value (OpenAI::Chat::ChatCompletionContentPart::File::File)

Returns:



28
# File 'lib/openai/models/chat/chat_completion_content_part.rb', line 28

required :file, -> { OpenAI::Chat::ChatCompletionContentPart::File::File }

#prompt_cache_breakpoint ⇒ OpenAI::Chat::ChatCompletionContentPart::File::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::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint, nil)


42
43
44
45
# File 'lib/openai/models/chat/chat_completion_content_part.rb', line 42

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

#type ⇒ :file

The type of the content part. Always file.

Returns:

  • (:file)


34
# File 'lib/openai/models/chat/chat_completion_content_part.rb', line 34

required :type, const: :file

Instance Method Details

#to_hash ⇒ { file: OpenAI::Chat::ChatCompletionContentPart::File::File, ?type: :file, ?prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint }

Returns:

  • ({ file: OpenAI::Chat::ChatCompletionContentPart::File::File, ?type: :file, ?prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint })


52
53
54
55
56
# File 'sig/openai/models/chat/chat_completion_content_part.rbs', line 52

def to_hash: -> {
  file: OpenAI::Chat::ChatCompletionContentPart::File::File,
  ?type: :file,
  ?prompt_cache_breakpoint: OpenAI::Chat::ChatCompletionContentPart::File::PromptCacheBreakpoint
}