batch_embeddings
Creates, updates, deletes, gets or lists a batch_embeddings resource.
Overview
| Name | batch_embeddings |
| Type | Resource |
| Id | gemini.models.batch_embeddings |
Fields
The following fields are returned by SELECT queries:
- batch_embed_contents
| Name | Datatype | Description |
|---|---|---|
embeddings | array | Output only. The embeddings for each request, in the same order as provided in the batch request. |
usageMetadata | object | Output only. The usage metadata for the request. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_embed_contents | select | modelsId | requests | Generates multiple embedding vectors from the input Content which consists of a batch of strings represented as EmbedContentRequest objects. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
modelsId | string | |
requests | array | Required. Embed requests for the batch. The model in each of these requests must match the model specified BatchEmbedContentsRequest.model. |
SELECT examples
- batch_embed_contents
Generates multiple embedding vectors from the input Content which consists of a batch of strings represented as EmbedContentRequest objects.
- Query Shape
- Query Example
SELECT
embeddings,
usageMetadata
FROM gemini.models.batch_embeddings
WHERE modelsId = '{{ modelsId }}' -- required
AND requests = '{{ requests }}'
;
SELECT
embeddings
FROM gemini.models.batch_embeddings
WHERE modelsId = 'gemini-embedding-001'
AND requests = '[
{"model": "models/gemini-embedding-001", "content": {"parts":[{"text":"first passage"}]}},
{"model": "models/gemini-embedding-001", "content": {"parts":[{"text":"second passage"}]}}
]'
;