Learn R Programming

gptstudio (version 0.4.0)

create_completion_google: Generate text completions using Google AI Studio's API

Description

Generate text completions using Google AI Studio's API

Usage

create_completion_google(
  prompt,
  model = "gemini-pro",
  key = Sys.getenv("GOOGLE_API_KEY")
)

Value

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

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 Google AI Studio's API. By default, the function will try to use the GOOGLE_API_KEY environment variable.

Examples

Run this code
if (FALSE) {
create_completion_google(
  prompt = "Write a story about a magic backpack",
  temperature = 1.0,
  candidate_count = 3
)
}

Run the code above in your browser using DataLab