Skip to content

Commit eb33a07

Browse files
[ML] Use internal user for internal inference action (elastic#128327) (elastic#128332)
* Using correct origin for inference action * Update docs/changelog/128327.yaml * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]> (cherry picked from commit 19e18a9) # Conflicts: # x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/inference/InferenceRunner.java
1 parent a20f045 commit eb33a07

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

docs/changelog/128327.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 128327
2+
summary: Use internal user for internal inference action
3+
area: Machine Learning
4+
type: bug
5+
issues: []

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankFeaturePhaseRankCoordinatorContext.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
import java.util.List;
2626
import java.util.Map;
2727

28+
import static org.elasticsearch.xpack.core.ClientHelper.INFERENCE_ORIGIN;
29+
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
30+
2831
/**
2932
* A {@code RankFeaturePhaseRankCoordinatorContext} that performs a rerank inference call to determine relevance scores for documents within
3033
* the provided rank window.
@@ -114,7 +117,7 @@ protected void computeScores(RankFeatureDoc[] featureDocs, ActionListener<float[
114117
List<String> featureData = Arrays.stream(featureDocs).map(x -> x.featureData).toList();
115118
InferenceAction.Request inferenceRequest = generateRequest(featureData);
116119
try {
117-
client.execute(InferenceAction.INSTANCE, inferenceRequest, inferenceListener);
120+
executeAsyncWithOrigin(client, INFERENCE_ORIGIN, InferenceAction.INSTANCE, inferenceRequest, inferenceListener);
118121
} finally {
119122
inferenceRequest.decRef();
120123
}

0 commit comments

Comments
 (0)