Interface InferenceServiceResults

All Superinterfaces:
ChunkedToXContent, NamedWriteable, Writeable

public interface InferenceServiceResults extends NamedWriteable, ChunkedToXContent
  • 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 to TransportVersions.V_8_12_0
    • asMap

      Map<String,Object> asMap()
      Convert the result to a map to aid with test assertions
    • isStreaming

      default boolean isStreaming()
      Returns true if these results are streamed as chunks, or false if these results contain the entire payload. Defaults to false.
    • publisher

      default Flow.Publisher<? extends ChunkedToXContent> publisher()
      When isStreaming() is true, the InferenceAction.Results will subscribe to this publisher. Implementations should follow the Flow.Publisher spec to stream the chunks.