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

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

Overview

See Also:

  • OpenAI::Resources::Beta::Threads::Messages#create

Defined Under Namespace

Modules: Role, Status Classes: Attachment, IncompleteDetails

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_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(type: :file_search) ⇒ Object

Parameters:

  • id

    The identifier, which can be referenced in API endpoints.

  • assistant_id

    If applicable, the ID of the assistant that authored this message.

  • attachments

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

  • completed_at

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

  • content

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

  • created_at

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

  • incomplete_at

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

  • incomplete_details

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

  • metadata

    Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

    Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

  • role

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

  • run_id

    The ID of the run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.

  • status

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

  • thread_id

    The thread ID that this message belongs to.

  • object

    The object type, which is always thread.message.



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

Instance Attribute Details

#assistant_idString?

If applicable, the ID of the assistant that authored this message.

Returns:

  • (String, nil)


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

required :assistant_id, String, nil?: true

#attachments::Array[OpenAI::Beta::Threads::Message::Attachment]?

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

Returns:

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


27
28
29
30
31
# File 'lib/openai/models/beta/threads/message.rb', line 27

required(
  :attachments,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::Threads::Message::Attachment] },
  nil?: true
)

#completed_atInteger?

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

Returns:

  • (Integer, nil)


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

required :completed_at, Integer, nil?: true

#content::Array[OpenAI::Models::Beta::Threads::message_content]

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

Returns:

  • (::Array[OpenAI::Models::Beta::Threads::message_content])


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

required :content, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::Threads::MessageContent] }

#created_atInteger

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

Returns:

  • (Integer)


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

required :created_at, Integer

#idString

The identifier, which can be referenced in API endpoints.

Returns:

  • (String)


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

required :id, String

#incomplete_atInteger?

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

Returns:

  • (Integer, nil)


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

required :incomplete_at, Integer, nil?: true

#incomplete_detailsOpenAI::Beta::Threads::Message::IncompleteDetails?

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

Returns:

  • (OpenAI::Beta::Threads::Message::IncompleteDetails, nil)


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

required :incomplete_details, -> { OpenAI::Beta::Threads::Message::IncompleteDetails }, nil?: true

#metadataOpenAI::Models::metadata?

Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.

Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters.

Returns:

  • (OpenAI::Models::metadata, nil)


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

required :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#object:"thread.message"

The object type, which is always thread.message.

Returns:

  • (:"thread.message")


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

required :object, const: :"thread.message"

#roleOpenAI::Models::Beta::Threads::Message::role

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

Returns:

  • (OpenAI::Models::Beta::Threads::Message::role)


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

required :role, enum: -> { OpenAI::Beta::Threads::Message::Role }

#run_idString?

The ID of the run associated with the creation of this message. Value is null when messages are created manually using the create message or create thread endpoints.

Returns:

  • (String, nil)


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

required :run_id, String, nil?: true

#statusOpenAI::Models::Beta::Threads::Message::status

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

Returns:

  • (OpenAI::Models::Beta::Threads::Message::status)


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

required :status, enum: -> { OpenAI::Beta::Threads::Message::Status }

#thread_idString

The thread ID that this message belongs to.

Returns:

  • (String)


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

required :thread_id, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

.variantsArray(OpenAI::Models::Beta::CodeInterpreterTool, OpenAI::Models::Beta::Threads::Message::Attachment::Tool::AssistantToolsFileSearchTypeOnly)



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

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {