Skip to content

Commit 93489dd

Browse files
committed
javadoc
1 parent f72c5b2 commit 93489dd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/results/EmbeddingResults.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@
1414
import java.io.IOException;
1515
import 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+
*/
1722
public 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
}

0 commit comments

Comments
 (0)