Skip to content

Commit 7e1b330

Browse files
authored
[ML]Fix the bug where the run() function of ExecutableInferenceRequest throws an exception when get inferenceEntityId. (#112135)
1 parent adb2353 commit 7e1b330

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

docs/changelog/112135.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pr: 112135
2+
summary: Fix the bug where the run() function of ExecutableInferenceRequest throws an exception when get inferenceEntityId.
3+
area: Inference
4+
type: bug

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/http/sender/ExecutableInferenceRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ record ExecutableInferenceRequest(
2929

3030
@Override
3131
public void run() {
32-
var inferenceEntityId = request.createHttpRequest().inferenceEntityId();
32+
var inferenceEntityId = request.getInferenceEntityId();
3333

3434
try {
3535
requestSender.send(logger, request, hasFinished, responseHandler, listener);

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/request/amazonbedrock/AmazonBedrockRequest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ public AmazonBedrockModel model() {
3737

3838
/**
3939
* Amazon Bedrock uses the AWS SDK, and will not create its own Http Request
40-
* But, this is needed for the ExecutableInferenceRequest to get the inferenceEntityId
41-
* @return NoOp request
4240
*/
4341
@Override
4442
public final HttpRequest createHttpRequest() {
45-
return new HttpRequest(new NoOpHttpRequest(), inferenceId);
43+
throw new UnsupportedOperationException("Amazon Bedrock does not use Http Requests");
4644
}
4745

4846
/**

0 commit comments

Comments
 (0)