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 Summary
Modifier and TypeMethodDescriptionvoidaddInferenceResponse(InferenceAction.Response inferenceResponse) Adds an inference response to the output.Builds the final output page from accumulated inference responses.static <IR extends InferenceServiceResults>
IRinferenceResults(InferenceAction.Response inferenceResponse, Class<IR> clazz) default voidreleasePageOnAnyThread(Page page) Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
addInferenceResponse
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
-