messages | R Documentation |
messages Class
messages Class
openaistream::openai
-> messages
create()
Create a message.
messages$create(thread_id, role, content, ..., verbosity = 0)
thread_id
character Required. The ID of the thread to create a message for.
role
character Required. The role of the entity that is creating the message. Currently only user is supported.
content
character Required. The content of the message.
...
Additional parameters as required by the OpenAI API. For example:file_ids,metadata
verbosity
numeric. 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.)
A message object.
retrieve()
Retrieve a message.
messages$retrieve(thread_id, message_id, verbosity = 0)
thread_id
character Required. The ID of the thread the message belongs to.
message_id
character Required. The ID of the message to retrieve.
verbosity
numeric. 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.)
The message object matching the specified ID.
modify()
Modifies a message.
messages$modify(thread_id, message_id, ..., verbosity = 0)
thread_id
character Required. The ID of the thread the message belongs to.
message_id
character Required. The ID of the message to retrieve.
...
Additional parameters as required by the OpenAI API. For example:metadata
verbosity
numeric. 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.)
The modified message object.
list()
Returns a list of messages for a given thread.
messages$list(thread_id, ..., verbosity = 0)
thread_id
character Required. The ID of the thread the messages belong to.
...
Additional parameters as required by the OpenAI API.
verbosity
numeric 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.)
A list of message objects.
file_retrieve()
Retrieves a message file.
messages$file_retrieve(thread_id, message_id, file_id, verbosity = 0)
thread_id
character Required. The ID of the thread the message belongs to.
message_id
character Required. The ID of the message the file belongs to.
file_id
character Required The ID of the file being retrieved.
verbosity
numeric Verbosity level for the API call(0:no output;1:show headers;
The message file object.
file_list()
Returns a list of message files.
messages$file_list(thread_id, message_id, ..., verbosity = 0)
thread_id
character Required. The ID of the thread the message belongs to.
message_id
character Required. The ID of the message the file belongs to.
...
Additional parameters as required by the OpenAI API.
verbosity
numeric Verbosity level for the API call(0:no output;1:show headers;
A list of message file objects.
clone()
The objects of this class are cloneable with this method.
messages$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.