Skip to content

Commit aed3f17

Browse files
Fixing test and updating code javadoc
1 parent d7c3e08 commit aed3f17

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/http/sender/ChatCompletionInput.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
package org.elasticsearch.xpack.inference.external.http.sender;
99

10+
import org.elasticsearch.inference.TaskType;
11+
1012
import java.util.List;
1113
import java.util.Objects;
1214

@@ -15,7 +17,7 @@
1517
* The main difference between this class and {@link UnifiedChatInput} is this should only be used for
1618
* {@link org.elasticsearch.inference.TaskType#COMPLETION} originating through the
1719
* {@link org.elasticsearch.inference.InferenceService#infer} code path. These are requests sent to the
18-
* API without using the <code>_unified</code> route.
20+
* API without using the {@link TaskType#CHAT_COMPLETION} task type.
1921
*/
2022
public class ChatCompletionInput extends InferenceInputs {
2123
private final List<String> input;

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/http/sender/UnifiedChatInput.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.action.ActionListener;
1111
import org.elasticsearch.core.TimeValue;
1212
import org.elasticsearch.inference.Model;
13+
import org.elasticsearch.inference.TaskType;
1314
import org.elasticsearch.inference.UnifiedCompletionRequest;
1415

1516
import java.util.List;
@@ -20,7 +21,7 @@
2021
* The main difference between this class and {@link ChatCompletionInput} is this should only be used for
2122
* {@link org.elasticsearch.inference.TaskType#COMPLETION} originating through the
2223
* {@link org.elasticsearch.inference.InferenceService#unifiedCompletionInfer(Model, UnifiedCompletionRequest, TimeValue, ActionListener)}
23-
* code path. These are requests sent to the API with the <code>_unified</code> route.
24+
* code path. These are requests sent to the API with the <code>_stream</code> route and {@link TaskType#CHAT_COMPLETION}.
2425
*/
2526
public class UnifiedChatInput extends InferenceInputs {
2627
private final UnifiedCompletionRequest request;

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/inference/inference_crud.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,3 @@
2525
}
2626
}
2727
- match: { error.reason: "Unknown task_type [bad]" }
28-
29-
---
30-
"Test inference with bad task type":
31-
- do:
32-
catch: bad_request
33-
inference.inference:
34-
task_type: bad
35-
inference_id: elser_model
36-
body: >
37-
{
38-
"input": "important text"
39-
}
40-
- match: { error.reason: "Unknown task_type [bad]" }
41-
42-

0 commit comments

Comments
 (0)