This class provides methods to interact with the OpenAI Assistant API.
Public fields
idThe ID of the assistant.
created_atThe creation time of the assistant.
nameThe name of the assistant.
descriptionThe description of the assistant.
modelID of the model to use. You can use the
oai_list_models()function to see all of your available models.instructionsThe system instructions that the assistant uses.
toolsA list of tool enabled on the assistant.
tool_resourcesA set of resources that are used by the assistant's tools.
metadataSet of 16 key-value pairs that can be attached to an object.
temperatureSampling temperature.
top_pAn alternative to sampling with temperature, called nucleus sampling.
response_formatThe response format of the assistant.
Methods
Method new()
Initializes the OpenAI Assistant object. You must provide either an assistant ID or a model. If you provide an assistant ID, the assistant is retrieved from the API. If you provide a model, a new assistant is created, and ... argument is used to pass additional arguments to the oai_create_assistant() function.
Usage
Assistant$new(
assistant_id = NULL,
model = NULL,
...,
resp = NULL,
.async = FALSE
)Arguments
assistant_idCharacter. The ID of the assistant to retrieve.
modelCharacter. ID of the model to use. You can use the
oai_list_models()to see all of your available models....Additional arguments passed to the
oai_*_assistant()functions.respList. The assistant's properties from the API response.
.asyncLogical. If
TRUE, requests are made asynchronously.
Method modify()
Modify the assistant's properties. The ... argument is used to pass additional arguments to the oai_modify_assistant() function.
Method print()
Method thread_and_run()
Arguments
threadAn oai_thread object.
messagesAlternatively, a list of messages to create a thread.
...Additional arguments passed to
oai_create_thread_and_run()..asyncLogical. If
TRUE, requests are made asynchronously.
