Learn R Programming

openaiRtools (version 0.2.2)

update_assistant: Update an Assistant (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and updates an existing assistant.

Usage

update_assistant(assistant_id, ...)

Value

The updated assistant object.

Arguments

assistant_id

Character. Required. The ID of the assistant to update.

...

Named fields to update. Supported: name, description, instructions, model, tools, tool_resources, metadata, temperature, response_format.

Examples

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

updated <- update_assistant(
  "asst_abc123",
  instructions = "You are now an expert in time series analysis.",
  model        = "gpt-4o"
)
cat("Updated model:", updated$model)
}

Run the code above in your browser using DataLab