Skip to content

Commit 35551eb

Browse files
Inference task type endpoints (#3545)
* Refactoring inference endpoints * Fixing stream completion url and removing the old url and class * generating spec * Adding doc id * Renaming to match filename * Switching to stream and regenerating files * Using variant and adding _stream * Removing variant * Adding chat_completion and fixing update api * Resolving conflicts
1 parent 8bec192 commit 35551eb

27 files changed

+1722
-944
lines changed

output/schema/schema.json

Lines changed: 1163 additions & 721 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/validation-errors.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,6 @@
156156
],
157157
"response": []
158158
},
159-
"inference.update": {
160-
"request": [
161-
"/_inference/{inference_id}/_update: different http methods in the json spec",
162-
"/_inference/{task_type}/{inference_id}/_update: different http methods in the json spec"
163-
],
164-
"response": []
165-
},
166159
"ingest.get_ip_location_database": {
167160
"request": [
168161
"Request: query parameter 'master_timeout' does not exist in the json spec"

output/typescript/types.ts

Lines changed: 119 additions & 79 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_doc_ids/table.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ inference-api-post,https://www.elastic.co/docs/api/doc/elasticsearch/operation/o
319319
inference-api-put,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put
320320
inference-api-put-watsonx,https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-watsonx-ai.html
321321
inference-api-stream,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-stream-inference
322+
inference-api-chat-completion,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-unified-inference
322323
inference-api-update,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-update
323324
inference-processor,https://www.elastic.co/guide/en/elasticsearch/reference/current/inference-processor.html
324325
info-api,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"inference.chat_completion_unified": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/chat-completion-inference.html",
5+
"description": "Perform chat completion inference"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": ["text/event-stream"],
11+
"content_type": ["application/json"]
12+
},
13+
"url": {
14+
"paths": [
15+
{
16+
"path": "/_inference/chat_completion/{inference_id}/_stream",
17+
"methods": ["POST"],
18+
"parts": {
19+
"inference_id": {
20+
"type": "string",
21+
"description": "The inference Id"
22+
}
23+
}
24+
}
25+
]
26+
},
27+
"body": {
28+
"description": "The inference payload"
29+
}
30+
}
31+
}

specification/_json_spec/inference.inference.json renamed to specification/_json_spec/inference.completion.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"inference.inference": {
2+
"inference.completion": {
33
"documentation": {
44
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
5-
"description": "Perform inference"
5+
"description": "Perform completion inference"
66
},
77
"stability": "stable",
88
"visibility": "public",
@@ -13,28 +13,14 @@
1313
"url": {
1414
"paths": [
1515
{
16-
"path": "/_inference/{inference_id}",
16+
"path": "/_inference/completion/{inference_id}",
1717
"methods": ["POST"],
1818
"parts": {
1919
"inference_id": {
2020
"type": "string",
2121
"description": "The inference Id"
2222
}
2323
}
24-
},
25-
{
26-
"path": "/_inference/{task_type}/{inference_id}",
27-
"methods": ["POST"],
28-
"parts": {
29-
"task_type": {
30-
"type": "string",
31-
"description": "The task type"
32-
},
33-
"inference_id": {
34-
"type": "string",
35-
"description": "The inference Id"
36-
}
37-
}
3824
}
3925
]
4026
},
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"inference.rerank": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
5+
"description": "Perform reranking inference"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": ["application/json"],
11+
"content_type": ["application/json"]
12+
},
13+
"url": {
14+
"paths": [
15+
{
16+
"path": "/_inference/rerank/{inference_id}",
17+
"methods": ["POST"],
18+
"parts": {
19+
"inference_id": {
20+
"type": "string",
21+
"description": "The inference Id"
22+
}
23+
}
24+
}
25+
]
26+
},
27+
"body": {
28+
"description": "The inference payload"
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)