File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
server/src/main/java/org/elasticsearch/inference
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ public static InputType fromRestString(String name) {
4444 return inputType ;
4545 }
4646
47- public static boolean isInternalType (InputType inputType ) {
48- return inputType == InputType .INTERNAL_INGEST || inputType == InputType .INTERNAL_SEARCH ;
47+ public static boolean isInternalTypeOrUnspecified (InputType inputType ) {
48+ return inputType == InputType .INTERNAL_INGEST || inputType == InputType .INTERNAL_SEARCH || inputType == InputType . UNSPECIFIED ;
4949 }
5050
5151 public static boolean isSpecified (InputType inputType ) {
Original file line number Diff line number Diff line change @@ -199,7 +199,9 @@ public ActionRequestValidationException validate() {
199199 }
200200 }
201201
202- if (taskType .equals (TaskType .TEXT_EMBEDDING ) == false && (inputType != null && InputType .isInternalType (inputType ) == false )) {
202+ if (taskType .equals (TaskType .TEXT_EMBEDDING ) == false
203+ && taskType .equals (TaskType .ANY ) == false
204+ && (inputType != null && InputType .isInternalTypeOrUnspecified (inputType ) == false )) {
203205 var e = new ActionRequestValidationException ();
204206 e .addValidationError (format ("Field [input_type] cannot be specified for task type [%s]" , taskType ));
205207 return e ;
You can’t perform that action at this time.
0 commit comments