powered by
Generate text completions using Google AI Studio's API
create_completion_google( prompt, model = "gemini-pro", key = Sys.getenv("GOOGLE_API_KEY") )
A list with the generated completions and other information returned by the API.
The prompt for generating completions
The model to use for generating text. By default, the function will try to use "text-bison-001"
The API key for accessing Google AI Studio's API. By default, the function will try to use the GOOGLE_API_KEY environment variable.
GOOGLE_API_KEY
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