gemini_docs | R Documentation |
Summarize, compare, or analyze the content of one or more local documents (PDF, TXT, HTML, etc.) using the Gemini API.
gemini_docs(
pdf_path,
prompt,
type = "PDF",
api_key = Sys.getenv("GEMINI_API_KEY")
)
pdf_path |
Path(s) to the local file(s). Can be a character vector. |
prompt |
The prompt to send to Gemini (e.g., "Summarize these documents"). |
type |
File type. One of "PDF", "JavaScript", "Python", "TXT", "HTML", "CSS", "Markdown", "CSV", "XML", "RTF". Default is "PDF". |
api_key |
Gemini API key. Defaults to |
This function encodes one or more local files, sends them along with a prompt to the Gemini API, and returns the generated summary or response.
The summary or response text from Gemini.
https://ai.google.dev/gemini-api/docs/document-processing?lang=rest
## Not run:
gemini_docs(
pdf_path = c("doc1.pdf", "doc2.pdf"),
prompt = "Compare these documents",
type = "PDF"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.