-
Notifications
You must be signed in to change notification settings - Fork 25.3k
[ML] Update inference api rest spec #124151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jonathan-buttner
merged 2 commits into
elastic:main
from
jonathan-buttner:ml-rest-api-spec-update
Mar 6, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
rest-api-spec/src/main/resources/rest-api-spec/api/inference.chat_completion_unified.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"inference.chat_completion_unified": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/chat-completion-inference.html", | ||
"description": "Perform chat completion inference" | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"text/event-stream" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_inference/chat_completion/{inference_id}/_stream", | ||
"methods": [ | ||
"POST" | ||
], | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The inference payload" | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
rest-api-spec/src/main/resources/rest-api-spec/api/inference.completion.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"inference.completion": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html", | ||
"description": "Perform completion inference" | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_inference/completion/{inference_id}", | ||
"methods": [ | ||
"POST" | ||
], | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The inference payload" | ||
} | ||
} | ||
} |
56 changes: 29 additions & 27 deletions
56
rest-api-spec/src/main/resources/rest-api-spec/api/inference.get.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
rest-api-spec/src/main/resources/rest-api-spec/api/inference.inference.json
This file was deleted.
Oops, something went wrong.
60 changes: 32 additions & 28 deletions
60
rest-api-spec/src/main/resources/rest-api-spec/api/inference.put.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,53 @@ | ||
{ | ||
"inference.put":{ | ||
"documentation":{ | ||
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html", | ||
"description":"Configure an inference endpoint for use in the Inference API" | ||
"inference.put": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html", | ||
"description": "Configure an inference endpoint for use in the Inference API" | ||
}, | ||
"stability":"stable", | ||
"visibility":"public", | ||
"headers":{ | ||
"accept": [ "application/json"], | ||
"content_type": ["application/json"] | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url":{ | ||
"paths":[ | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path":"/_inference/{inference_id}", | ||
"methods":[ | ||
"path": "/_inference/{inference_id}", | ||
"methods": [ | ||
"PUT" | ||
], | ||
"parts":{ | ||
"inference_id":{ | ||
"type":"string", | ||
"description":"The inference Id" | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
}, | ||
{ | ||
"path":"/_inference/{task_type}/{inference_id}", | ||
"methods":[ | ||
"path": "/_inference/{task_type}/{inference_id}", | ||
"methods": [ | ||
"PUT" | ||
], | ||
"parts":{ | ||
"task_type":{ | ||
"type":"string", | ||
"description":"The task type" | ||
"parts": { | ||
"task_type": { | ||
"type": "string", | ||
"description": "The task type" | ||
}, | ||
"inference_id":{ | ||
"type":"string", | ||
"description":"The inference Id" | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body":{ | ||
"description":"The inference endpoint's task and service settings" | ||
"body": { | ||
"description": "The inference endpoint's task and service settings" | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
rest-api-spec/src/main/resources/rest-api-spec/api/inference.rerank.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"inference.rerank": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html", | ||
"description": "Perform reranking inference" | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_inference/rerank/{inference_id}", | ||
"methods": [ | ||
"POST" | ||
], | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The inference payload" | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
rest-api-spec/src/main/resources/rest-api-spec/api/inference.sparse_embedding.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"inference.sparse_embedding": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html", | ||
"description": "Perform sparse embedding inference" | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"application/json" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_inference/sparse_embedding/{inference_id}", | ||
"methods": [ | ||
"POST" | ||
], | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The inference payload" | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
rest-api-spec/src/main/resources/rest-api-spec/api/inference.stream_completion.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"inference.stream_completion": { | ||
"documentation": { | ||
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html", | ||
"description": "Perform streaming inference" | ||
}, | ||
"stability": "stable", | ||
"visibility": "public", | ||
"headers": { | ||
"accept": [ | ||
"text/event-stream" | ||
], | ||
"content_type": [ | ||
"application/json" | ||
] | ||
}, | ||
"url": { | ||
"paths": [ | ||
{ | ||
"path": "/_inference/completion/{inference_id}/_stream", | ||
"methods": [ | ||
"POST" | ||
], | ||
"parts": { | ||
"inference_id": { | ||
"type": "string", | ||
"description": "The inference Id" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"body": { | ||
"description": "The inference payload" | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.