token.vertex | R Documentation |
Generates an access token for the Gemini model and constructs the corresponding endpoint URL.
token.vertex(
jsonkey = NULL,
model_id = NULL,
expTime = 3600,
region = "us-central1"
)
jsonkey |
A path to JSON file containing the service account key from Vertex AI. |
model_id |
The ID of the Gemini model. This will be prepended with "gemini-". |
expTime |
The expiration time of the access token in seconds (default is 3600 seconds, or 1 hour). |
region |
The Google Cloud region where your Vertex AI resources are located (default is "us-central1"). See https://cloud.google.com/vertex-ai/docs/general/locations for available regions. |
A list containing:
key |
The generated access token. |
url |
The endpoint URL for the Gemini model. |
## Not run:
library(gemini.R)
tokens <- token.vertex(jsonkey = "YOURAPIKEY.json", model_id = "1.5-flash")
# Specify a different region
tokens <- token.vertex(jsonkey = "YOURAPIKEY.json", model_id = "1.5-flash", region = "europe-west4")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.