Skip to content

Commit 595859f

Browse files
committed
Remove uri field and use getter
1 parent b4b1f05 commit 595859f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/request/elastic/rerank/ElasticInferenceServiceRerankRequest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
public class ElasticInferenceServiceRerankRequest extends ElasticInferenceServiceRequest {
3030

31-
private final URI uri;
3231
private final String query;
3332
private final List<String> documents;
3433
private final TraceContextHandler traceContextHandler;
@@ -45,13 +44,12 @@ public ElasticInferenceServiceRerankRequest(
4544
this.query = query;
4645
this.documents = documents;
4746
this.model = Objects.requireNonNull(model);
48-
this.uri = model.uri();
4947
this.traceContextHandler = new TraceContextHandler(traceContext);
5048
}
5149

5250
@Override
5351
public HttpRequestBase createHttpRequestBase() {
54-
var httpPost = new HttpPost(uri);
52+
var httpPost = new HttpPost(getURI());
5553
var requestEntity = Strings.toString(
5654
new ElasticInferenceServiceRerankRequestEntity(
5755
query,
@@ -81,7 +79,7 @@ public String getInferenceEntityId() {
8179

8280
@Override
8381
public URI getURI() {
84-
return uri;
82+
return model.uri();
8583
}
8684

8785
@Override

0 commit comments

Comments
 (0)