Class: OpenAI::Model::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/openai/models/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Message

Returns a new instance of Message.



47
48
49
50
51
# File 'lib/openai/models/message.rb', line 47

def initialize(attributes)
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#assistant_idString | nil (readonly)

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

Returns:

  • (String | nil)

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



36
37
38
# File 'lib/openai/models/message.rb', line 36

def assistant_id
  @assistant_id
end

#attachmentsString (readonly)

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

Returns:

  • (String)

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



42
43
44
# File 'lib/openai/models/message.rb', line 42

def attachments
  @attachments
end

#completed_atInteger | nil (readonly)

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

Returns:

  • (Integer | nil)

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



24
25
26
# File 'lib/openai/models/message.rb', line 24

def completed_at
  @completed_at
end

#contentString (readonly)

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

Returns:

  • (String)

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



33
34
35
# File 'lib/openai/models/message.rb', line 33

def content
  @content
end

#created_atInteger (readonly)

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

Returns:

  • (Integer)

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



12
13
14
# File 'lib/openai/models/message.rb', line 12

def created_at
  @created_at
end

#idString (readonly)

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

Returns:

  • (String)

    The identifier, which can be referenced in API endpoints.



6
7
8
# File 'lib/openai/models/message.rb', line 6

def id
  @id
end

#incomplete_atInteger | nil (readonly)

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

Returns:

  • (Integer | nil)

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



27
28
29
# File 'lib/openai/models/message.rb', line 27

def incomplete_at
  @incomplete_at
end

#incomplete_detailsString | nil (readonly)

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

Returns:

  • (String | nil)

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



21
22
23
# File 'lib/openai/models/message.rb', line 21

def incomplete_details
  @incomplete_details
end

#metadataHash[String, String] (readonly)

Returns 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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.

Returns:

  • (Hash[String, String])

    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. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.



45
46
47
# File 'lib/openai/models/message.rb', line 45

def 
  
end

#objectString (readonly)

Returns The object type, which is always thread.message.

Returns:

  • (String)

    The object type, which is always thread.message



9
10
11
# File 'lib/openai/models/message.rb', line 9

def object
  @object
end

#roleString (readonly)

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

Returns:

  • (String)

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



30
31
32
# File 'lib/openai/models/message.rb', line 30

def role
  @role
end

#run_idString | nil (readonly)

Returns 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)

    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.



39
40
41
# File 'lib/openai/models/message.rb', line 39

def run_id
  @run_id
end

#statusString (readonly)

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

Returns:

  • (String)

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



18
19
20
# File 'lib/openai/models/message.rb', line 18

def status
  @status
end

#thread_idInteger (readonly)

Returns The thread ID that this message belongs to.

Returns:

  • (Integer)

    The thread ID that this message belongs to.



15
16
17
# File 'lib/openai/models/message.rb', line 15

def thread_id
  @thread_id
end