This class provides methods to interact with the OpenAI Assistant API.
Public fields
id
The ID of the assistant.
created_at
The creation time of the assistant.
name
The name of the assistant.
description
The description of the assistant.
model
ID of the model to use. You can use the
oai_list_models()
function to see all of your available models.instructions
The system instructions that the assistant uses.
tools
A list of tool enabled on the assistant.
tool_resources
A set of resources that are used by the assistant's tools.
metadata
Set of 16 key-value pairs that can be attached to an object.
temperature
Sampling temperature.
top_p
An alternative to sampling with temperature, called nucleus sampling.
response_format
The 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_id
Character. The ID of the assistant to retrieve.
model
Character. 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.resp
List. The assistant's properties from the API response.
.async
Logical. 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
thread
An oai_thread object.
messages
Alternatively, a list of messages to create a thread.
...
Additional arguments passed to
oai_create_thread_and_run()
..async
Logical. If
TRUE
, requests are made asynchronously.