Interface InferenceOperator.OutputBuilder

All Superinterfaces:
AutoCloseable, Closeable, org.elasticsearch.core.Releasable
All Known Implementing Classes:
CompletionOperatorOutputBuilder, RerankOperatorOutputBuilder
Enclosing class:
InferenceOperator

public static interface InferenceOperator.OutputBuilder extends org.elasticsearch.core.Releasable
An interface for accumulating inference responses and constructing a result Page.
  • Method Details

    • addInferenceResponse

      void addInferenceResponse(InferenceAction.Response inferenceResponse)
      Adds an inference response to the output.

      The responses must be added in the same order as the corresponding inference requests were generated. Failing to preserve order may lead to incorrect or misaligned output rows.

      Parameters:
      inferenceResponse - The inference response to include.
    • buildOutput

      Page buildOutput()
      Builds the final output page from accumulated inference responses.
      Returns:
      The constructed output page.
    • inferenceResults

      static <IR extends InferenceServiceResults> IR inferenceResults(InferenceAction.Response inferenceResponse, Class<IR> clazz)
    • releasePageOnAnyThread

      default void releasePageOnAnyThread(Page page)