
Last chance! 50% off unlimited learning
Sale ends in
Generate text from text with Gemini Vertex API
gemini.vertex(
prompt = NULL,
tokens = NULL,
temperature = 1,
maxOutputTokens = 8192,
topK = 40,
topP = 0.95,
seed = 1234
)
A character string containing the generated text.
A character string containing the prompt for the Gemini model.
A list containing the API URL and key from token.vertex() function.
The temperature to use. Default is 1 value should be between 0 and 2 see https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters
The maximum number of tokens to generate. Default is 8192 and 100 tokens correspond to roughly 60-80 words.
The top-k value to use. Default is 40 value should be between 0 and 100 see https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters
The top-p value to use. Default is 0.95 value should be between 0 and 1 see https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters
The seed to use. Default is 1234 value should be integer see https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters
https://ai.google.dev/docs/gemini_api_overview#text_input
if (FALSE) {
# token should be created before this. using the token.vertex() function
prompt <- "What is sachins Jersey number?"
gemini.vertex(prompt, tokens)
}
Run the code above in your browser using DataLab