Perform inference on the service Added in 8.11.0
Path parameters
-
The inference Id
Query parameters
-
timeout string
Specifies the amount of time to wait for the inference request to complete.
Body
-
query string
Query input, required for rerank task. Not required for other tasks.
input string | array[string] Required
Inference input. Either a string or an array of strings.
-
task_settings object
Additional properties are allowed.
POST
/_inference/{inference_id}
curl \
-X POST http://api.example.com/_inference/{inference_id} \
-H "Content-Type: application/json" \
-d '{"query":"string","input":"string","task_settings":{}}'
Request examples
{
"query": "string",
"input": "string",
"task_settings": {}
}
Response examples (200)
{
"text_embedding_bytes": [
{
"embedding": [
42.0
]
}
],
"text_embedding": [
{
"embedding": [
42.0
]
}
],
"sparse_embedding": [
{
"embedding": {
"additionalProperty1": 42.0,
"additionalProperty2": 42.0
}
}
],
"completion": [
{
"result": "string"
}
],
"rerank": [
{
"index": 42.0,
"score": 42.0,
"text": "string"
}
]
}