Class EmbeddingOutputBuilder
java.lang.Object
org.elasticsearch.xpack.esql.inference.embedding.EmbeddingOutputBuilder
- All Implemented Interfaces:
InferenceOperator.OutputBuilder
Builds output pages for embedding inference operations.
Converts DenseEmbeddingResults from inference responses into a FloatBlock that is appended
to the input page. Each embedding vector is stored as a multi-valued position containing the vector components.
This base class is used by both text embedding and typed embedding operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildOutputPage(Page inputPage, List<InferenceOperator.BulkInferenceResponseItem> responses) Builds the output page by converting inference responses into aFloatBlock.
-
Constructor Details
-
EmbeddingOutputBuilder
-
-
Method Details
-
buildOutputPage
public Page buildOutputPage(Page inputPage, List<InferenceOperator.BulkInferenceResponseItem> responses) Builds the output page by converting inference responses into aFloatBlock.The position value counts in each response determine how output values are distributed across rows:
- positionValueCounts[i] = 0: produces a null value for row i (no embedding)
- positionValueCounts[i] = 1: produces one embedding vector for row i
- Specified by:
buildOutputPagein interfaceInferenceOperator.OutputBuilder- Parameters:
inputPage- The original input pageresponses- The ordered list of inference responses corresponding to the input rows- Returns:
- A new page with the embedding vectors appended as an additional block
-