Class GoogleGenAiBatchEmbeddingModel
java.lang.Object
dev.langchain4j.model.google.genai.GoogleGenAiBatchEmbeddingModel
- All Implemented Interfaces:
BatchEmbeddingModel
@Experimental
public final class GoogleGenAiBatchEmbeddingModel
extends Object
implements BatchEmbeddingModel
Provides an interface for interacting with the Google GenAI Batch API for Embedding models.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voidCancels an embedding batch operation that is currently pending or running.voiddeleteBatchJob(String batchId) Deletes a batch job from the system.list(BatchPagination pagination) Lists embedding batch jobs with optional pagination.Retrieves the current state and results of an embedding batch operation.submit(BatchRequest<TextSegment> request) Creates a batch of text segments and submits them for asynchronous embedding processing.Creates a batch of embedding requests from an uploaded file.submit(String displayName, List<TextSegment> requests) Creates and enqueues a batch of embedding requests for asynchronous processing.
-
Method Details
-
builder
-
submit
Description copied from interface:BatchEmbeddingModelCreates a batch of text segments and submits them for asynchronous embedding processing.The returned
BatchResponserepresents the status of the batch operation.- Specified by:
submitin interfaceBatchEmbeddingModel- Parameters:
request- the list of text segments to embed in the batch- Returns:
- a
BatchResponserepresenting the initial state of the batch operation
-
retrieve
Description copied from interface:BatchEmbeddingModelRetrieves the current state and results of an embedding batch operation.The response indicates whether the batch is still processing, completed successfully, or failed. Use this to retrieve the computed embeddings once the state is success.
- Specified by:
retrievein interfaceBatchEmbeddingModel- Parameters:
batchId- the batch identifier obtained fromBatchEmbeddingModel.submit(BatchRequest)- Returns:
- a
BatchResponserepresenting the current state of the embedding batch operation
-
cancel
Description copied from interface:BatchEmbeddingModelCancels an embedding batch operation that is currently pending or running.- Specified by:
cancelin interfaceBatchEmbeddingModel- Parameters:
batchId- the batch identifier to cancel
-
list
Description copied from interface:BatchEmbeddingModelLists embedding batch jobs with optional pagination.- Specified by:
listin interfaceBatchEmbeddingModel- Parameters:
pagination- the maximum number of batch jobs to return and token for retrieving a specific page; if null, uses server default- Returns:
- a
BatchPagecontaining embedding batch responses and pagination information
-
submit
Creates and enqueues a batch of embedding requests for asynchronous processing.- Parameters:
displayName- a user-defined name for the batchrequests- a list of text segments to be embedded in the batch- Returns:
- a
BatchResponserepresenting the initial state of the batch operation
-
submit
public BatchResponse<Response<Embedding>> submit(String displayName, com.google.genai.types.File file) Creates a batch of embedding requests from an uploaded file.- Parameters:
displayName- a user-defined name for the batchfile- the Google GenAI File object representing the uploaded file containing batch requests- Returns:
- a
BatchResponserepresenting the initial state of the batch operation
-
deleteBatchJob
Deletes a batch job from the system.
-