Perform decision inference on the service
- POST /_inference/decision/{inference_id}
Answer a set of named questions about an input, such as whether a customer is complaining, which team should handle a request, or how angry a customer is.
The questions are defined in the task settings of the inference endpoint, and can be replaced for a single request through task_settings.
Only the elastic service currently supports the decision task.
Required privileges
- Cluster privileges monitor_inference
Request body
-
inputunion oneOfrequired -
The input to answer the questions about. It can be specified as a string, or as an object. The object form additionally allows specifying images.
string example:
"input": "I was charged twice for my order and nobody answers my emails."object example:
"input": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } - One of:
-
typeenumrequired -
The type of input to embed. Not all models support all input types. The
audio,video, andpdftypes are available in Elasticsearch 9.5.0 and later. -
Values:
textimageaudiovideopdf -
formatenum -
The format of the input. For the
texttype this must betext. For all other types, this must bebase64orurl. If not specified, this will default totextfor thetexttype andbase64for all other types. Theurlformat is available in Elasticsearch 9.6.0 and later. Not all services and models support all formats. -
Values:
textbase64url -
task_settingsobject -
Task settings for the individual inference request. These settings override the task settings specified when creating the inference endpoint.
-
questionsmap string to oneOf -
The questions to answer, keyed by question name. The answers in the response use the same names. The questions replace the ones of the inference endpoint as a whole. At least one question is required.
-
<string>union oneOf
An object containing the input data for a single item for the model to embed.
type: predicate
A question answered with the probability that the statement in instructions is true.
type: choice
A question answered with one option out of a fixed set of choices.
type: score
A question answered with the probability-weighted position on an ordered scale of levels.