Learn R Programming

openaiRtools (version 0.2.2)

OpenAI: OpenAI Client Class

Description

Main client class for interacting with OpenAI API. Compatible with Python OpenAI SDK interface.

Arguments

Methods


Method new()

Usage

OpenAI$new(
  api_key = NULL,
  base_url = NULL,
  organization = NULL,
  project = NULL,
  timeout = 600,
  max_retries = 2
)


Method build_headers()

Usage

OpenAI$build_headers()


Method request()

Usage

OpenAI$request(
  method,
  path,
  body = NULL,
  query = NULL,
  stream = FALSE,
  callback = NULL
)


Method request_multipart()

Usage

OpenAI$request_multipart(method, path, ...)


Method request_raw()

Usage

OpenAI$request_raw(method, path, body = NULL)


Method clone()

The objects of this class are cloneable with this method.

Usage

OpenAI$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.