Learn R Programming

openaiRtools (version 0.2.2)

AssistantsClient: Assistants Client (Beta)

Description

An Assistant is a configured AI entity with a model, instructions, and optional tools. It operates on ThreadsClient (conversations) by creating Runs that execute the assistant's logic.

Arguments

Typical workflow

  1. Create an assistant: client$assistants$create(model, instructions, tools)

  2. Create a thread: client$threads$create()

  3. Add a user message: client$threads$messages$create(thread_id, "user", "...")

  4. Create a run: client$threads$runs$create(thread_id, assistant_id)

  5. Poll the run until status is "completed"

  6. Read the assistant's reply: client$threads$messages$list(thread_id)

Methods


Method new()

Usage

AssistantsClient$new(parent)


Method create()

Usage

AssistantsClient$create(
  model,
  name = NULL,
  description = NULL,
  instructions = NULL,
  tools = NULL,
  tool_resources = NULL,
  metadata = NULL,
  temperature = NULL,
  top_p = NULL,
  response_format = NULL
)


Method list()

Usage

AssistantsClient$list(limit = NULL, order = NULL, after = NULL, before = NULL)


Method retrieve()

Usage

AssistantsClient$retrieve(assistant_id)


Method update()

Usage

AssistantsClient$update(assistant_id, ...)


Method delete()

Usage

AssistantsClient$delete(assistant_id)


Method clone()

The objects of this class are cloneable with this method.

Usage

AssistantsClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Client for the OpenAI Assistants API v2 (Beta). Assistants are AI agents that can use tools (code interpreter, file search, custom functions) and maintain persistent state. Access via client$assistants.