Perform dense embedding inference on the service
- POST /_inference/embedding/{inference_id}
Request body
-
inputunionrequired -
Inference input. Either a string, an array of strings, a
contentobject, or an array ofcontentobjects.contentobjects may contain a single item or an array of items. Models that support multiple items percontentobject will return a single embedding for eachcontentobject, regardless of how many items it contains. Support for multiple items in a singlecontentobject is available in Elasticsearch 9.5.0 and later.string example:
"input": "Some text"string array example:
"input": ["Some text", "Some more text"]contentobject example:"input": { "content": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } }contentobject array example:"input": [ { "content": { "type": "text", "format": "text", "value": "Some text to generate an embedding" } }, { "content": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } } ]Multiple items in one
contentobject example (available in Elasticsearch 9.5.0 and later):"input": [ { "content": [ { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." }, { "type": "text", "value": "Some text to create an embedding" } ] } ] -
input_typestring -
The input data type for the embedding model. Possible values include:
SEARCHINGESTCLASSIFICATIONCLUSTERING
Not all models support all values. Unsupported values will trigger a validation exception. Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.
NoteThe
input_typeparameter specified on the root level of the request body will take precedence over theinput_typeparameter specified intask_settings.