Class TextEmbedding
java.lang.Object
org.elasticsearch.xpack.esql.core.tree.Node<Expression>
org.elasticsearch.xpack.esql.core.expression.Expression
org.elasticsearch.xpack.esql.core.expression.function.Function
org.elasticsearch.xpack.esql.expression.function.inference.InferenceFunction<TextEmbedding>
org.elasticsearch.xpack.esql.expression.function.inference.TextEmbedding
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable
TEXT_EMBEDDING function converts text to dense vector embeddings using an inference endpoint.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
Expression.TypeResolutionNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.xpack.esql.expression.function.inference.InferenceFunction
INFERENCE_ID_PARAMETER_NAMEFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondataType()TheDataTypereturned by executing the tree rooted at this expression.booleanbooleanfoldable()Whether the expression can be evaluated statically, aka "folded", or not.inthashCode()The inference endpoint identifier expression.protected NodeInfo<? extends Expression> info()Normally, you want to use one of the staticcreatemethods to implement this.replaceChildren(List<Expression> newChildren) protected Expression.TypeResolutionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method.taskType()The task type required by this function (e.g., TEXT_EMBEDDING).toString()withInferenceResolutionError(String inferenceId, String error) Returns a copy with inference resolution error for display to user.voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.expression.function.inference.InferenceFunction
hasNestedInferenceFunctionMethods inherited from class org.elasticsearch.xpack.esql.core.expression.function.Function
arguments, functionName, nodeString, nullableMethods inherited from class org.elasticsearch.xpack.esql.core.expression.Expression
canonical, canonicalize, childrenResolved, fold, propertiesToString, references, resolved, semanticEquals, semanticHash, typeResolvedMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, replaceChildrenSameSize, source, sourceLocation, sourceText, transformChildren, transformDown, transformDown, transformDown, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Constructor Details
-
TextEmbedding
-
-
Method Details
-
writeTo
- Throws:
IOException
-
getWriteableName
-
inputText
-
inferenceId
Description copied from class:InferenceFunctionThe inference endpoint identifier expression.- Specified by:
inferenceIdin classInferenceFunction<TextEmbedding>
-
foldable
public boolean foldable()Description copied from class:ExpressionWhether the expression can be evaluated statically, aka "folded", or not.- Overrides:
foldablein classExpression
-
dataType
Description copied from class:ExpressionTheDataTypereturned by executing the tree rooted at this expression. IfExpression.typeResolved()returns an error then the behavior of this method is undefined. It may return a valid type. Or it may throw an exception. Or it may return a totally nonsensical type.- Specified by:
dataTypein classExpression
-
resolveType
Description copied from class:ExpressionThe implementation ofExpression.typeResolved(), which is just a caching wrapper around this method. See it's javadoc for what this method should return.Implementations will rarely interact with the
Expression.TypeResolutionclass directly, instead usually calling the utility methods onTypeResolutions.Implementations should fail if
Expression.childrenResolved()returnsfalse.- Overrides:
resolveTypein classExpression
-
taskType
Description copied from class:InferenceFunctionThe task type required by this function (e.g., TEXT_EMBEDDING).- Specified by:
taskTypein classInferenceFunction<TextEmbedding>
-
withInferenceResolutionError
Description copied from class:InferenceFunctionReturns a copy with inference resolution error for display to user.- Specified by:
withInferenceResolutionErrorin classInferenceFunction<TextEmbedding>
-
replaceChildren
- Specified by:
replaceChildrenin classNode<Expression>
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<Expression>
-
toString
- Overrides:
toStringin classExpression
-
equals
-
hashCode
public int hashCode()
-