| messages {openaistream} | R Documentation |
messages Class
Description
messages Class
messages Class
Super class
openaistream::openai -> messages
Methods
Public methods
Inherited methods
Method create()
Create a message.
Usage
messages$create(thread_id, role, content, ..., verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread to create a message for.
rolecharacter Required. The role of the entity that is creating the message. Currently only user is supported.
contentcharacter Required. The content of the message.
...Additional parameters as required by the OpenAI API. For example:file_ids,metadata
verbositynumeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.)
Returns
A message object.
Method retrieve()
Retrieve a message.
Usage
messages$retrieve(thread_id, message_id, verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread the message belongs to.
message_idcharacter Required. The ID of the message to retrieve.
verbositynumeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.)
Returns
The message object matching the specified ID.
Method modify()
Modifies a message.
Usage
messages$modify(thread_id, message_id, ..., verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread the message belongs to.
message_idcharacter Required. The ID of the message to retrieve.
...Additional parameters as required by the OpenAI API. For example:metadata
verbositynumeric. Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.)
Returns
The modified message object.
Method list()
Returns a list of messages for a given thread.
Usage
messages$list(thread_id, ..., verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread the messages belong to.
...Additional parameters as required by the OpenAI API.
verbositynumeric Verbosity level for the API call(0:no output;1:show headers; 2:show headers and bodies;3: show headers, bodies, and curl status messages.)
Returns
A list of message objects.
Method file_retrieve()
Retrieves a message file.
Usage
messages$file_retrieve(thread_id, message_id, file_id, verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread the message belongs to.
message_idcharacter Required. The ID of the message the file belongs to.
file_idcharacter Required The ID of the file being retrieved.
verbositynumeric Verbosity level for the API call(0:no output;1:show headers;
Returns
The message file object.
Method file_list()
Returns a list of message files.
Usage
messages$file_list(thread_id, message_id, ..., verbosity = 0)
Arguments
thread_idcharacter Required. The ID of the thread the message belongs to.
message_idcharacter Required. The ID of the message the file belongs to.
...Additional parameters as required by the OpenAI API.
verbositynumeric Verbosity level for the API call(0:no output;1:show headers;
Returns
A list of message file objects.
Method clone()
The objects of this class are cloneable with this method.
Usage
messages$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.