All Bundles

Message

Create messages within threads

Derived from: EndPoint

Operations

Create

Loads a message

function : Create(role:String, content:String, thread:API.OpenAI.Thread, token:String) ~ API.OpenAI.Message
Parameters
NameTypeDescription
roleStringrole of the entity that is creating the message
contentStringcontent of the message.
threadThreadthread associated with message
tokenStringAPI token

Return
TypeDescription
Messageloaded Message

Create a message.

function : Create(role:String, content:String, thread:API.OpenAI.Thread, files:Vector<API.OpenAI.File>, token:String) ~ API.OpenAI.Message
Parameters
NameTypeDescription
roleStringrole of the entity that is creating the message
contentStringcontent of the message.
threadThreadthread associated with message
filesFile<>list to attach to the message
tokenStringAPI token

Return
TypeDescription
Messagenewly created message

GetContents

Get the content of the message

method : public : GetContents() ~ Vector<Pair<String,String>>
Return
TypeDescription
Vector<Pair<String,String>>list of messages with roles

GetCreatedAt

Unix timestamp (in seconds) of when the object instance was created

method : public : GetCreatedAt() ~ Int
Return
TypeDescription
Inttime with the object instance was created

GetId

Get object instance API ID

method : public : GetId() ~ String
Return
TypeDescription
Stringinstance ID

GetObject

Get the object type

method : public : GetObject() ~ String
Return
TypeDescription
Stringobject type

GetRole

Get the role of the entity that is creating the message

method : public : GetRole() ~ String
Return
TypeDescription
Stringrole of the entity that is creating the message

GetThreadId

Get the ID of the thread associated with message

method : public : GetThreadId() ~ String
Return
TypeDescription
Stringthread ID

ListMessages

Loads a messages associated with thread

function : ListMessages(thread:API.OpenAI.Thread, token:String) ~ Vector<API.OpenAI.Message>
Parameters
NameTypeDescription
threadThreadthread associated with message
tokenStringAPI token

Return
TypeDescription
Message<>messages associated with thread

Load

Loads a message

function : Load(id:String, thread:API.OpenAI.Thread, token:String) ~ API.OpenAI.Message
Parameters
NameTypeDescription
idStringmessage ID
threadThreadthread associated with message
tokenStringAPI token

Return
TypeDescription
Messageloaded Message

ToString

String representation of the object

method : public : ToString() ~ String
Return
TypeDescription
Stringstring representation