Learn R Programming

openaiRtools (version 0.2.2)

delete_file: Delete an Uploaded File (Convenience Function)

Description

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

Usage

delete_file(file_id)

Value

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

Arguments

file_id

Character. Required. The file ID to delete.

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")

result <- delete_file("file-abc123")
if (result$deleted) cat("File deleted successfully.")
}

Run the code above in your browser using DataLab