Skip to content

Commit f15c030

Browse files
davidkyleHuaixinww
andauthored
[ML]Fix the bug where the run() function of ExecutableInferenceRequest throws an exception when get inferenceEntityId. (#112135) (#112393)
Co-authored-by: Huaixinww <[email protected]>
1 parent 9f845d5 commit f15c030

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
@@ -30,7 +30,7 @@ record ExecutableInferenceRequest(
3030

3131
@Override
3232
public void run() {
33-
var inferenceEntityId = request.createHttpRequest().inferenceEntityId();
33+
var inferenceEntityId = request.getInferenceEntityId();
3434

3535
try {
3636
requestSender.send(logger, request, HttpClientContext.create(), 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)