This function interfaces with Google Cloud Vertex AI to generate text using the Gemini model. It allows for specifying various parameters like project ID, location ID, model ID, and more, to customize the text generation process. https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini#sample_requests
gcva_gemini_text(
projectId = gcva_project_get(),
locationId = gcva_region_get(),
modelId = c("gemini-1.5-flash-001", "gemini-1.5-pro-001", "gemini-1.0-pro-001",
"gemini-1.0-pro-vision-001", "gemini-1.0-pro", "gemini-1.0-pro-001",
"gemini-1.0-pro-002"),
stream = FALSE,
role = c("user"),
prompt,
data = NULL,
mimeType = NULL,
fileUri = NULL,
startOffsetSeconds = NULL,
startOffsetNanos = NULL,
endOffsetSeconds = NULL,
endOffsetNanos = NULL,
functionDeclarations = NULL,
harmCategory = c("HARM_CATEGORY_SEXUALLY_EXPLICIT", "HARM_CATEGORY_HATE_SPEECH",
"HARM_CATEGORY_HARASSMENT", "HARM_CATEGORY_DANGEROUS_CONTENT"),
harmThreshold = "BLOCK_ONLY_HIGH",
candidateCount = NULL,
temperature = NULL,
maxOutputTokens = NULL,
topP = NULL,
topK = NULL,
stopSequences = NULL
)
The ID of the Google Cloud project. Default is retrieved using `gcva_project_get()`.
The location ID for the AI model. Default is retrieved using `gcva_region_get()`.
Character vector specifying the model ID
Logical; whether to stream the output. ALWAYS FALSE
Character string specifying the input prompt for text generation.
Categories of harmful content to be filtered, with defaults set.
Threshold for blocking harmful content, default is "BLOCK_ONLY_HIGH".
Controls randomness in response generation, default is 0.5.
Maximum number of tokens that can be generated in the response. A token is approximately four characters. 100 tokens correspond to roughly 60-80 words.
Controls diversity of generated responses
Limits the number of high probability tokens considered for each step
A response object from the Google Cloud Vertex AI.