Skip to content

Commit a65a12b

Browse files
Moving file and removing commented code
1 parent b061fe2 commit a65a12b

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomService.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.inference.SettingsConfiguration;
2727
import org.elasticsearch.inference.SimilarityMeasure;
2828
import org.elasticsearch.inference.TaskType;
29-
import org.elasticsearch.inference.validation.CustomServiceIntegrationValidator;
3029
import org.elasticsearch.inference.validation.ServiceIntegrationValidator;
3130
import org.elasticsearch.rest.RestStatus;
3231
import org.elasticsearch.xpack.inference.external.action.SenderExecutableAction;
@@ -37,6 +36,7 @@
3736
import org.elasticsearch.xpack.inference.services.ConfigurationParseContext;
3837
import org.elasticsearch.xpack.inference.services.SenderService;
3938
import org.elasticsearch.xpack.inference.services.ServiceComponents;
39+
import org.elasticsearch.xpack.inference.services.validation.CustomServiceIntegrationValidator;
4040

4141
import java.util.EnumSet;
4242
import java.util.HashMap;
@@ -200,16 +200,8 @@ public void doInfer(
200200

201201
@Override
202202
protected void validateInputType(InputType inputType, Model model, ValidationException validationException) {
203-
// We will support all values. If one of the values is not included in the translation map, we'll use the default provided instead
204-
// if (model instanceof CustomModel customModel) {
205-
// var translationKeys = customModel.getServiceSettings().getInputTypeTranslator().getTranslation().keySet();
206-
// var supportedInputTypes = translationKeys.isEmpty() ? EnumSet.noneOf(InputType.class) : EnumSet.copyOf(translationKeys);
207-
// ServiceUtils.validateInputTypeAgainstAllowlist(inputType, supportedInputTypes, SERVICE_NAME, validationException);
208-
// } else {
209-
// validationException.addValidationError(
210-
// Strings.format("Model of type [%s] is not supported by the %s service", model.getClass().getSimpleName(), NAME)
211-
// );
212-
// }
203+
// The custom service doesn't do any validation for the input type because if the input type is supported a default
204+
// must be supplied within the service settings.
213205
}
214206

215207
@Override

server/src/main/java/org/elasticsearch/inference/validation/CustomServiceIntegrationValidator.java renamed to x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/validation/CustomServiceIntegrationValidator.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the "Elastic License
4-
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5-
* Public License v 1"; you may not use this file except in compliance with, at
6-
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7-
* License v3.0 only", or the "Server Side Public License, v 1".
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
86
*/
97

10-
package org.elasticsearch.inference.validation;
8+
package org.elasticsearch.xpack.inference.services.validation;
119

1210
import org.elasticsearch.ElasticsearchStatusException;
1311
import org.elasticsearch.action.ActionListener;
@@ -17,6 +15,7 @@
1715
import org.elasticsearch.inference.InputType;
1816
import org.elasticsearch.inference.Model;
1917
import org.elasticsearch.inference.TaskType;
18+
import org.elasticsearch.inference.validation.ServiceIntegrationValidator;
2019
import org.elasticsearch.rest.RestStatus;
2120

2221
import java.util.List;

0 commit comments

Comments
 (0)