Skip to contents

Generate text completions using PALM (MakerSuite)'s API

Usage

create_completion_palm(
  prompt,
  model = "text-bison-001",
  key = Sys.getenv("PALM_API_KEY"),
  temperature = 0.5,
  candidate_count = 1
)

Arguments

prompt

The prompt for generating completions

model

The model to use for generating text. By default, the function will try to use "text-bison-001"

key

The API key for accessing PALM (MakerSuite)'s API. By default, the function will try to use the PALM_API_KEY environment variable.

temperature

The temperature to control the randomness of the model's output

candidate_count

The number of completion candidates to generate

Value

A list with the generated completions and other information returned by the API.

Examples

if (FALSE) {
create_completion_palm(
  prompt = list(text = "Write a story about a magic backpack"),
  temperature = 1.0,
  candidate_count = 3
)
}