Class: OpenAI::Models::Beta::Threads::Message::Attachment

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

Defined Under Namespace

Modules: Tool

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:, assistant_id:, attachments:, completed_at:, content:, created_at:, incomplete_at:, incomplete_details:, metadata:, role:, run_id:, status:, thread_id:, object: :"thread.message") ⇒ Object

Parameters:

  • file_id —

    The ID of the file to attach to the message.

  • tools —

    The tools to add this file to.



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/openai/models/beta/threads/message.rb', line 164

class Attachment < OpenAI::Internal::Type::BaseModel
  # @!attribute file_id
  #   The ID of the file to attach to the message.
  #
  #   @return [String, nil]
  optional :file_id, String

  # @!attribute tools
  #   The tools to add this file to.
  #
  #   @return [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly>, nil]
  optional(
    :tools,
    -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::Threads::Message::Attachment::Tool] }
  )

  # @!method initialize(file_id: nil, tools: nil)
  #   @param file_id [String]
  #     The ID of the file to attach to the message.
  #
  #   @param tools [Array<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly>]
  #     The tools to add this file to.
  module Tool
    extend OpenAI::Internal::Type::Union

    variant -> { OpenAI::Beta::CodeInterpreterTool }

    variant -> { OpenAI::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly }

    class AssistantToolsFileSearchTypeOnly < OpenAI::Internal::Type::BaseModel
      # @!attribute type
      #   The type of tool being defined: `file_search`
      #
      #   @return [Symbol, :file_search]
      required :type, const: :file_search

      # @!method initialize(type: :file_search)
      #   @param type [Symbol, :file_search]
      #     The type of tool being defined: `file_search`
    end

    # @!method self.variants
    #   @return [Array(OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly)]
  end
end

Instance Attribute Details

#file_id ⇒ String?

The ID of the file to attach to the message.

Returns:

  • (String, nil)


169
# File 'lib/openai/models/beta/threads/message.rb', line 169

optional :file_id, String

#tools ⇒ ::Array[OpenAI::Models::Beta::Threads::Message::Attachment::tool]?

The tools to add this file to.

Returns:

  • (::Array[OpenAI::Models::Beta::Threads::Message::Attachment::tool], nil)


175
176
177
178
# File 'lib/openai/models/beta/threads/message.rb', line 175

optional(
  :tools,
  -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::Threads::Message::Attachment::Tool] }
)

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


180
# File 'sig/openai/models/beta/threads/message.rbs', line 180

def to_hash: -> {