Summarize, compare, or analyze the content of one or more documents (PDF, TXT, HTML, etc.) using Vertex AI Gemini.
Usage
gemini_docs.vertex(
file_uri,
prompt,
mime_type = "application/pdf",
tokens = NULL,
temperature = 1,
maxOutputTokens = 8192,
topK = 40,
topP = 0.95,
seed = 1234
)
Arguments
- file_uri
The URI(s) or URL(s) of the file(s) to include in the prompt. Accepts Cloud Storage URI (gs://...), HTTP(S) URL, or YouTube video URL.
- prompt
The text instructions to include in the prompt.
- mime_type
The media type of the file (e.g., "application/pdf", "text/plain").
- tokens
A list containing the API URL and key from token.vertex() function.
- temperature
The temperature to use. Default is 1.
- maxOutputTokens
The maximum number of tokens to generate. Default is 8192.
- topK
The top-k value to use. Default is 40.
- topP
The top-p value to use. Default is 0.95.
- seed
The seed to use. Default is 1234.
Examples
if (FALSE) { # \dontrun{
tokens <- token.vertex()
gemini_docs.vertex(
file_uri = "gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf",
prompt = "Summarize this document.",
mime_type = "application/pdf",
tokens = tokens
)
} # }