File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1414import java .io .IOException ;
1515import java .util .List ;
1616
17+ /**
18+ * The results of a call to the inference service that contains embeddings (sparse or dense).
19+ * A call to the inference service may contain multiple input texts, so this results may
20+ * contain multiple results.
21+ */
1722public interface EmbeddingResults <C extends EmbeddingResults .Chunk , R extends EmbeddingResults .Embedding <C >>
1823 extends
1924 InferenceServiceResults {
2025
26+ /**
27+ * A resulting embedding together with its input text.
28+ */
2129 interface Chunk {
2230 ChunkedInference .Chunk toChunk (XContent xcontent ) throws IOException ;
2331
@@ -26,9 +34,18 @@ interface Chunk {
2634 ChunkedInference .TextOffset offset ();
2735 }
2836
37+ /**
38+ * A resulting embedding for one of the input texts to the inference service.
39+ */
2940 interface Embedding <C extends Chunk > {
41+ /**
42+ * Combines the resulting embedding with the input into a chunk.
43+ */
3044 C toChunk (String text , ChunkedInference .TextOffset offset );
3145 }
3246
47+ /**
48+ * The resulting list of embeddings for the input texts to the inference service.
49+ */
3350 List <R > embeddings ();
3451}
You can’t perform that action at this time.
0 commit comments