Module org.elasticsearch.server
Package org.elasticsearch.inference
Interface InferenceServiceResults
- All Superinterfaces:
ChunkedToXContent
,NamedWriteable
,Writeable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
Convert the result to a map to aid with test assertionsdefault boolean
Returnstrue
if these results are streamed as chunks, orfalse
if these results contain the entire payload.default Flow.Publisher
<? extends ChunkedToXContent> WhenisStreaming()
istrue
, the InferenceAction.Results will subscribe to this publisher.List
<? extends InferenceResults> Transform the result to match the format required for the TransportCoordinatedInferenceAction.List
<? extends InferenceResults> Transform the result to match the format required for versions prior toTransportVersions.V_8_12_0
Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunked, toXContentChunked, toXContentChunkedV8
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
-
Method Details
-
transformToCoordinationFormat
List<? extends InferenceResults> transformToCoordinationFormat()Transform the result to match the format required for the TransportCoordinatedInferenceAction. For the inference plugin TextEmbeddingResults, the
transformToLegacyFormat()
transforms the results into an intermediate format only used by the plugin's return value. It doesn't align with what the TransportCoordinatedInferenceAction expects. TransportCoordinatedInferenceAction expects an ml plugin TextEmbeddingResults.For other results like SparseEmbeddingResults, this method can be a pass through to the transformToLegacyFormat.
-
transformToLegacyFormat
List<? extends InferenceResults> transformToLegacyFormat()Transform the result to match the format required for versions prior toTransportVersions.V_8_12_0
-
asMap
Convert the result to a map to aid with test assertions -
isStreaming
default boolean isStreaming()Returnstrue
if these results are streamed as chunks, orfalse
if these results contain the entire payload. Defaults tofalse
. -
publisher
WhenisStreaming()
istrue
, the InferenceAction.Results will subscribe to this publisher. Implementations should follow theFlow.Publisher
spec to stream the chunks.
-