Learn R Programming

openaiRtools (version 0.2.2)

retrieve_run: Retrieve a Run (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and retrieves a run's current status.

Usage

retrieve_run(thread_id, run_id)

Value

A run object with $status ("queued", "in_progress", "completed", "requires_action", "failed", etc.).

Arguments

thread_id

Character. Required. The thread ID.

run_id

Character. Required. The run ID.

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")
run <- retrieve_run("thread_abc123", "run_abc123")
cat("Status:", run$status)
}

Run the code above in your browser using DataLab