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_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.)

Returns

A message object.


Method retrieve()

Retrieve a message.

Usage
messages$retrieve(thread_id, message_id, verbosity = 0)
Arguments
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.)

Returns

The message object matching the specified ID.


Method modify()

Modifies a message.

Usage
messages$modify(thread_id, message_id, ..., verbosity = 0)
Arguments
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.)

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_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.)

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_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;

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_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;

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
deep

Whether to make a deep clone.


[Package openaistream version 0.2.0 Index]