Assistant Tasks
This feature is currently marked as a “Beta” by OpenAI. Make sure to check our their How Assistants Work and Assistants Overview guides.
Assistants
Build assistants that can call models and use tools to perform tasks. Official OpenAI docs
create()
Create an assistant with a model and instructions. Official OpenAI Docs
update()
Update an assistant. Official OpenAI Docs
list()
List assistants. Official OpenAI Docs
retrieve()
Retrieve an assistant. Official OpenAI Docs
del()
Delete an assistant. Official OpenAI Docs
Threads
Create threads that assistants can interact with. Official OpenAI docs
create()
Create a thread. Official OpenAI Docs
createAndRun()
Create a thread and run it in one task.
createAndRunUntilCompletion()
Create a thread and runs it in one task, and only returns when the run is completed by polling in the background using io.backgroundPoll().
retrieve()
Retrieves a thread. Official OpenAI Docs
update()
Modifies a thread. Official OpenAI Docs
del()
Deletes a thread. Official OpenAI Docs
Messages
Create messages within threads. Official OpenAI docs
list()
List messages in a thread.
If you want to list all messages in a thread, you can use the listAll()
helper:
This will automatically paginate through all messages in the thread and return them as a single array.
create()
Create a message. Official OpenAI Docs
retrieve()
Retrieve a message. Official OpenAI Docs
update()
Update a message. Official OpenAI Docs
Runs
Represents an execution run on a thread. Official OpenAI docs
list()
List all runs belonging to a thread.
create()
Create a run. Official OpenAI Docs
createAndWaitForCompletion()
Create a run and only return when the run is completed by polling in the background using io.backgroundPoll().
waitForCompletion()
Wait for a run to complete by polling in the background using io.backgroundPoll().
retrieve()
Retrieve a run. Official OpenAI Docs
cancel()
Cancels a run that is in_progress
. Official OpenAI Docs
submitToolOutputs()
When a run has the status: "requires_action"
and required_action.type
is submit_tool_outputs
, this endpoint can be used to submit the outputs from the tool calls once they’re all completed. All outputs must be submitted in a single request. Official OpenAI Docs
list()
Returns all runs belonging to a thread. Official OpenAI Docs
Was this page helpful?