Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"inference.inference": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
"description": "Perform inference"
},
"stability": "stable",
"visibility": "public",
"headers": {
"accept": ["application/json"],
"content_type": ["application/json"]
},
"url": {
"paths": [
{
"path": "/_inference/{inference_id}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in most places we're directing users to include the task_type in the URL. Would it cause problems if we remove this path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing to call the Inference API without a task type is how Kibana deploys a model. Enforcing the task type apparently makes things more complex here.

"methods": ["POST"],
"parts": {
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
},
{
"path": "/_inference/{task_type}/{inference_id}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this form as it is covered by inference.text_embedding, inference.sparse_embedding etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mainly wanted to include it for backward compatibility. It could prove helpful if a new task type is added to Elasticsearch but not added immediately in the specification, but a missing task type sounds much less likely than a missing provider. We could deprecate this form.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could prove helpful if a new task type is added to Elasticsearch but not added immediately in the specification

True, let's leave it in for now if it becomes problematic it can be removed without breaking any existing usage as the inference.{TASK_TYPE} cases cover everything.

"methods": ["POST"],
"parts": {
"task_type": {
"type": "string",
"description": "The task type"
},
"inference_id": {
"type": "string",
"description": "The inference Id"
}
}
}
]
},
"body": {
"description": "The inference payload"
}
}
}