Learn R Programming

openaiRtools (version 0.2.2)

update_thread: Update a Thread (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and updates a thread's metadata.

Usage

update_thread(thread_id, ...)

Value

The updated thread object.

Arguments

thread_id

Character. Required. The thread ID.

...

Named fields to update, e.g. metadata = list(label = "session-2").

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")
update_thread("thread_abc123", metadata = list(topic = "GMM lecture"))
}

Run the code above in your browser using DataLab