|
26 | 26 | import org.elasticsearch.inference.SettingsConfiguration; |
27 | 27 | import org.elasticsearch.inference.SimilarityMeasure; |
28 | 28 | import org.elasticsearch.inference.TaskType; |
29 | | -import org.elasticsearch.inference.validation.CustomServiceIntegrationValidator; |
30 | 29 | import org.elasticsearch.inference.validation.ServiceIntegrationValidator; |
31 | 30 | import org.elasticsearch.rest.RestStatus; |
32 | 31 | import org.elasticsearch.xpack.inference.external.action.SenderExecutableAction; |
|
37 | 36 | import org.elasticsearch.xpack.inference.services.ConfigurationParseContext; |
38 | 37 | import org.elasticsearch.xpack.inference.services.SenderService; |
39 | 38 | import org.elasticsearch.xpack.inference.services.ServiceComponents; |
| 39 | +import org.elasticsearch.xpack.inference.services.validation.CustomServiceIntegrationValidator; |
40 | 40 |
|
41 | 41 | import java.util.EnumSet; |
42 | 42 | import java.util.HashMap; |
@@ -200,16 +200,8 @@ public void doInfer( |
200 | 200 |
|
201 | 201 | @Override |
202 | 202 | 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. |
213 | 205 | } |
214 | 206 |
|
215 | 207 | @Override |
|
0 commit comments