From 2939262f2f2313a7e2f3f3634552819a0d1d706b Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Tue, 13 Feb 2024 12:40:20 +0100 Subject: [PATCH] Removing useless interface --- .../ml/inference/results/ChunkedTextEmbeddingResults.java | 3 +-- .../ml/inference/results/ChunkedTextExpansionResults.java | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextEmbeddingResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextEmbeddingResults.java index 60af509f11070..e47554aebbadf 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextEmbeddingResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextEmbeddingResults.java @@ -10,7 +10,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; -import org.elasticsearch.inference.InferenceResultChunk; import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; @@ -24,7 +23,7 @@ public class ChunkedTextEmbeddingResults extends ChunkedNlpInferenceResults { - public record EmbeddingChunk(String matchedText, double[] embedding) implements Writeable, ToXContentObject, InferenceResultChunk { + public record EmbeddingChunk(String matchedText, double[] embedding) implements Writeable, ToXContentObject { public EmbeddingChunk(StreamInput in) throws IOException { this(in.readString(), in.readDoubleArray()); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextExpansionResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextExpansionResults.java index 4c304fedc6765..a002281408907 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextExpansionResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedTextExpansionResults.java @@ -9,7 +9,8 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.inference.InferenceResultChunk; +import org.elasticsearch.common.io.stream.Writeable; +import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; import java.io.IOException; @@ -23,7 +24,9 @@ public class ChunkedTextExpansionResults extends ChunkedNlpInferenceResults { public static final String NAME = "chunked_text_expansion_result"; public record ChunkedResult(String matchedText, List weightedTokens) - implements InferenceResultChunk { + implements + Writeable, + ToXContentObject { public ChunkedResult(StreamInput in) throws IOException { this(in.readString(), in.readCollectionAsList(TextExpansionResults.WeightedToken::new));