mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
[ML] Add hint about using input_output in the inference processor to error message (#129864)
This commit is contained in:
parent
788e18f4d2
commit
aaee222dfa
2 changed files with 8 additions and 2 deletions
|
@ -150,7 +150,9 @@ public class CoordinatedInferenceIngestIT extends InferenceBaseRestTest {
|
||||||
var responseMap = simulatePipeline(ExampleModels.nlpModelPipelineDefinitionWithFieldMap(inferenceServiceModelId), docs);
|
var responseMap = simulatePipeline(ExampleModels.nlpModelPipelineDefinitionWithFieldMap(inferenceServiceModelId), docs);
|
||||||
var simulatedDocs = (List<Map<String, Object>>) responseMap.get("docs");
|
var simulatedDocs = (List<Map<String, Object>>) responseMap.get("docs");
|
||||||
var errorMsg = (String) MapHelper.dig("error.reason", simulatedDocs.get(0));
|
var errorMsg = (String) MapHelper.dig("error.reason", simulatedDocs.get(0));
|
||||||
assertThat(errorMsg, containsString("[is_model] is configured for the _inference API and does not accept documents as input"));
|
var expectedMessage = "[is_model] is configured for the _inference API and does not accept documents as input. "
|
||||||
|
+ "If using an inference ingest processor configure it with the [input_output] option instead of [field_map].";
|
||||||
|
assertThat(errorMsg, containsString(expectedMessage));
|
||||||
assertThat(simulatedDocs, hasSize(2));
|
assertThat(simulatedDocs, hasSize(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,11 @@ public class TransportCoordinatedInferenceAction extends HandledTransportAction<
|
||||||
ActionListener.wrap(
|
ActionListener.wrap(
|
||||||
model -> listener.onFailure(
|
model -> listener.onFailure(
|
||||||
new ElasticsearchStatusException(
|
new ElasticsearchStatusException(
|
||||||
"[" + modelId + "] is configured for the _inference API and does not accept documents as input",
|
"["
|
||||||
|
+ modelId
|
||||||
|
+ "] is configured for the _inference API and does not accept documents as input. "
|
||||||
|
+ "If using an inference ingest processor configure it with the [input_output] option instead of "
|
||||||
|
+ "[field_map].",
|
||||||
RestStatus.BAD_REQUEST
|
RestStatus.BAD_REQUEST
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue