Learn R Programming

openaiRtools (version 0.2.2)

retrieve_assistant: Retrieve an Assistant (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and retrieves a specific assistant.

Usage

retrieve_assistant(assistant_id)

Value

An assistant object with $id, $name, $model, $instructions, $tools, and $created_at.

Arguments

assistant_id

Character. Required. The assistant ID (e.g. "asst_abc123").

Examples

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

asst <- retrieve_assistant("asst_abc123")
cat("Name:", asst$name)
cat("Model:", asst$model)
}

Run the code above in your browser using DataLab