Learn R Programming

openaiRtools (version 0.2.2)

CompletionsClient: Completions Client (Legacy)

Description

Note: This is the legacy "instruct" style API. For most use cases, use ChatCompletionsClient (client$chat$completions) instead. The Completions API is suitable only for "gpt-3.5-turbo-instruct" and "davinci-002". It takes a raw text prompt and returns a completion.

Arguments

Methods


Method new()

Usage

CompletionsClient$new(parent)


Method create()

Usage

CompletionsClient$create(
  prompt,
  model = "gpt-3.5-turbo-instruct",
  max_tokens = NULL,
  temperature = NULL,
  top_p = NULL,
  n = NULL,
  stream = NULL,
  logprobs = NULL,
  echo = NULL,
  stop = NULL,
  presence_penalty = NULL,
  frequency_penalty = NULL,
  best_of = NULL,
  logit_bias = NULL,
  user = NULL,
  callback = NULL
)


Method clone()

The objects of this class are cloneable with this method.

Usage

CompletionsClient$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Client for the OpenAI Completions API (legacy text completion endpoint). Access via client$completions.