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

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

Defined Under Namespace

Modules: Tool

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, inspect, #inspect, 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") ⇒ void

Some parameter documentations has been truncated, see OpenAI::Models::Beta::Threads::Message for more details.

Represents a message within a thread.

Parameters:

  • (defaults to: )

    The identifier, which can be referenced in API endpoints.

  • (defaults to: )

    If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-re

  • (defaults to: )

    A list of files attached to the message, and the tools they were added to.

  • (defaults to: )

    The Unix timestamp (in seconds) for when the message was completed.

  • (defaults to: )

    The content of the message in array of text and/or images.

  • (defaults to: )

    The Unix timestamp (in seconds) for when the message was created.

  • (defaults to: )

    The Unix timestamp (in seconds) for when the message was marked as incomplete.

  • (defaults to: )

    On an incomplete message, details about why the message is incomplete.

  • (defaults to: )

    Set of 16 key-value pairs that can be attached to an object. This can be

  • (defaults to: )

    The entity that produced the message. One of user or assistant.

  • (defaults to: )

    The ID of the run associa

  • (defaults to: )

    The status of the message, which can be either in_progress, incomplete, or `

  • (defaults to: )

    The thread ID that thi

  • (defaults to: :"thread.message")

    The object type, which is always thread.message.



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
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
# File 'lib/openai/models/beta/threads/message.rb', line 144

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_idString?

The ID of the file to attach to the message.

Returns:



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

optional :file_id, String

#toolsArray<OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly>?

The tools to add this file to.

Returns:



155
156
157
158
# File 'lib/openai/models/beta/threads/message.rb', line 155

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