gemini_garden {gemini.R} | R Documentation |
Interact with Vertex AI Model Garden
Description
This function sends a PDF file to the Vertex AI Model Garden (Mistral model) for processing, such as OCR. The PDF is encoded as base64 and sent to the rawPredict endpoint. The function is designed for future extension to support other document types and tasks.
Usage
gemini_garden(token, project_id, pdf_path)
Arguments
token |
Token object (e.g., from |
project_id |
Google Cloud project ID. |
pdf_path |
Path to the PDF file to be processed. |
Details
The PDF file is read and encoded as base64, then sent to the Vertex AI rawPredict endpoint for processing using a Mistral model. This function is structured for future extension to support other document types and model tasks available in Vertex AI Model Garden.
For more information about available models, endpoints, and supported tasks, see Vertex AI Model Garden documentation.
Value
A parsed list containing the results from the Vertex AI API (e.g., OCR results).
See Also
https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/explore-models
Examples
## Not run:
# Issue a token using token.vertex() first
my_token <- token.vertex(
jsonkey = "your-service-account.json",
region = "us-central1",
model_id = "mistral-ocr-2505"
)
result <- gemini_garden(
token = my_token,
project_id = "your-project-id",
pdf_path = "sample.pdf"
)
print(result)
## End(Not run)