Module org.elasticsearch.xcore
Class TextEmbeddingUtils
java.lang.Object
org.elasticsearch.xpack.core.inference.results.TextEmbeddingUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetFirstEmbeddingSize(List<EmbeddingInt> embeddings) Returns the first text embedding entry's array size.static voidvalidateInputSizeAgainstEmbeddings(List<String> inputs, int embeddingSize) Throws an exception if the number of elements in the input text list is different than the results in text embedding response.
-
Method Details
-
getFirstEmbeddingSize
Returns the first text embedding entry's array size.- Parameters:
embeddings- the list of embeddings- Returns:
- the size of the text embedding
- Throws:
IllegalStateException- if the list of embeddings is empty
-
validateInputSizeAgainstEmbeddings
Throws an exception if the number of elements in the input text list is different than the results in text embedding response.
-