Skip to content

Commit 84bc649

Browse files
committed
Fixing integration tests
1 parent 20c28b0 commit 84bc649

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

server/src/main/java/org/elasticsearch/inference/InputType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/inference/action/InferenceAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)