| embed_google_gemini | R Documentation |
Embed using Google Vertex API platform
embed_google_gemini(
x,
model = "gemini-embedding-001",
base_url = "https://generativelanguage.googleapis.com/v1beta",
api_key = get_envvar("GEMINI_API_KEY"),
dims = NULL,
task_type = "RETRIEVAL_QUERY",
batch_size = 20L
)
embed_google_vertex(
x,
model,
location,
project_id,
task_type = "RETRIEVAL_QUERY"
)
x |
x can be:
|
model |
Character specifying the embedding model. See supported models in Text embeddings API |
base_url |
string, url where the service is available. |
api_key |
resolved using env var |
dims |
An integer, can be used to truncate the embedding to a specific size. |
task_type |
Used to convey intended downstream application to help the
model produce better embeddings. If left blank, the default used is
|
batch_size |
split |
location |
Location, e.g. |
project_id |
Project ID. |
embed_google_gemini(): Use the Gemini API to create embeddings.
embed_google_gemini("hello world")
## Not run:
embed_google_vertex(
"hello world",
model="gemini-embedding-001",
project = "<your-project-id>",
location = "us-central1"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.