Learn R Programming

openaiRtools (version 0.2.2)

delete_thread: Delete a Thread (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and permanently deletes a thread.

Usage

delete_thread(thread_id)

Value

A list with $deleted (TRUE) and $id.

Arguments

thread_id

Character. Required. The thread ID to delete.

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")
result <- delete_thread("thread_abc123")
if (result$deleted) cat("Thread deleted.")
}

Run the code above in your browser using DataLab