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, 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

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

Represents a message within a [thread](platform.openai.com/docs/api-reference/threads).

Parameters:

  • The identifier, which can be referenced in API endpoints.

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

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

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

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

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

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

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

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

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

  • The ID of the [run](platform.openai.com/docs/api-reference/runs) associa

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

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

    The object type, which is always thread.message.



141
142
143
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
# File 'lib/openai/models/beta/threads/message.rb', line 141

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:



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

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:



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

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