Class TextEmbeddingOperator
java.lang.Object
org.elasticsearch.compute.operator.AsyncOperator<InferenceOperator.OngoingInferenceResult>
org.elasticsearch.xpack.esql.inference.InferenceOperator
org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperator
- All Implemented Interfaces:
Closeable,AutoCloseable,Operator,org.elasticsearch.core.Releasable
TextEmbeddingOperator is an InferenceOperator that performs text embedding inference.
It evaluates a text expression for each input row, constructs text embedding inference requests,
and emits the dense vector embeddings as output.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordFactory for creatingTextEmbeddingOperatorinstances.Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.inference.InferenceOperator
InferenceOperator.OngoingInferenceResult, InferenceOperator.OutputBuilderNested classes/interfaces inherited from class org.elasticsearch.compute.operator.AsyncOperator
AsyncOperator.StatusNested classes/interfaces inherited from interface org.elasticsearch.compute.operator.Operator
Operator.OperatorFactory -
Field Summary
Fields inherited from interface org.elasticsearch.compute.operator.Operator
MIN_TARGET_PAGE_SIZE, NOT_BLOCKED, TARGET_PAGE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionTextEmbeddingOperator(DriverContext driverContext, BulkInferenceRunner bulkInferenceRunner, String inferenceId, EvalOperator.ExpressionEvaluator textEvaluator, int maxOutstandingPages) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoClose()protected org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperatorOutputBuilderoutputBuilder(Page input) Creates a newTextEmbeddingOperatorOutputBuilderto collect and emit the text embedding results.protected BulkInferenceRequestIteratorConstructs the text embedding inference requests iterator for the given input page by evaluating the text expression.toString()Methods inherited from class org.elasticsearch.xpack.esql.inference.InferenceOperator
blockFactory, getOutput, inferenceId, performAsync, releaseFetchedOnAnyThreadMethods inherited from class org.elasticsearch.compute.operator.AsyncOperator
addInput, close, fetchFromBuffer, finish, isBlocked, isFinished, needsInput, releasePageOnAnyThread, status, status
-
Constructor Details
-
TextEmbeddingOperator
public TextEmbeddingOperator(DriverContext driverContext, BulkInferenceRunner bulkInferenceRunner, String inferenceId, EvalOperator.ExpressionEvaluator textEvaluator, int maxOutstandingPages)
-
-
Method Details
-
doClose
protected void doClose()- Specified by:
doClosein classAsyncOperator<InferenceOperator.OngoingInferenceResult>
-
toString
-
requests
Constructs the text embedding inference requests iterator for the given input page by evaluating the text expression.- Specified by:
requestsin classInferenceOperator- Parameters:
inputPage- The input data page.
-
outputBuilder
protected org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperatorOutputBuilder outputBuilder(Page input) Creates a newTextEmbeddingOperatorOutputBuilderto collect and emit the text embedding results.- Specified by:
outputBuilderin classInferenceOperator- Parameters:
input- The input page for which results will be constructed.
-