Skip to content

Commit 4284881

Browse files
[ML] Update inference api rest spec (#124151) (#124208)
* Pulling api spec changes * Fixing test and updating code javadoc
1 parent 4b6096a commit 4284881

File tree

14 files changed

+288
-215
lines changed

14 files changed

+288
-215
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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": [
11+
"text/event-stream"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
16+
},
17+
"url": {
18+
"paths": [
19+
{
20+
"path": "/_inference/chat_completion/{inference_id}/_stream",
21+
"methods": [
22+
"POST"
23+
],
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
28+
}
29+
}
30+
}
31+
]
32+
},
33+
"body": {
34+
"description": "The inference payload"
35+
}
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"inference.completion": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
5+
"description": "Perform completion inference"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
16+
},
17+
"url": {
18+
"paths": [
19+
{
20+
"path": "/_inference/completion/{inference_id}",
21+
"methods": [
22+
"POST"
23+
],
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
28+
}
29+
}
30+
}
31+
]
32+
},
33+
"body": {
34+
"description": "The inference payload"
35+
}
36+
}
37+
}

rest-api-spec/src/main/resources/rest-api-spec/api/inference.get.json

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
{
2-
"inference.get":{
3-
"documentation":{
4-
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html",
5-
"description":"Get an inference endpoint"
2+
"inference.get": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html",
5+
"description": "Get an inference endpoint"
66
},
7-
"stability":"stable",
8-
"visibility":"public",
9-
"headers":{
10-
"accept": [ "application/json"]
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
]
1113
},
12-
"url":{
13-
"paths":[
14+
"url": {
15+
"paths": [
1416
{
15-
"path":"/_inference",
16-
"methods":[
17+
"path": "/_inference",
18+
"methods": [
1719
"GET"
1820
]
1921
},
2022
{
21-
"path":"/_inference/{inference_id}",
22-
"methods":[
23+
"path": "/_inference/{inference_id}",
24+
"methods": [
2325
"GET"
2426
],
25-
"parts":{
26-
"inference_id":{
27-
"type":"string",
28-
"description":"The inference Id"
27+
"parts": {
28+
"inference_id": {
29+
"type": "string",
30+
"description": "The inference Id"
2931
}
3032
}
3133
},
3234
{
33-
"path":"/_inference/{task_type}/{inference_id}",
34-
"methods":[
35+
"path": "/_inference/{task_type}/{inference_id}",
36+
"methods": [
3537
"GET"
3638
],
37-
"parts":{
38-
"task_type":{
39-
"type":"string",
40-
"description":"The task type"
39+
"parts": {
40+
"task_type": {
41+
"type": "string",
42+
"description": "The task type"
4143
},
42-
"inference_id":{
43-
"type":"string",
44-
"description":"The inference Id"
44+
"inference_id": {
45+
"type": "string",
46+
"description": "The inference Id"
4547
}
4648
}
4749
}

rest-api-spec/src/main/resources/rest-api-spec/api/inference.inference.json

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,53 @@
11
{
2-
"inference.put":{
3-
"documentation":{
4-
"url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html",
5-
"description":"Configure an inference endpoint for use in the Inference API"
2+
"inference.put": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html",
5+
"description": "Configure an inference endpoint for use in the Inference API"
66
},
7-
"stability":"stable",
8-
"visibility":"public",
9-
"headers":{
10-
"accept": [ "application/json"],
11-
"content_type": ["application/json"]
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
1216
},
13-
"url":{
14-
"paths":[
17+
"url": {
18+
"paths": [
1519
{
16-
"path":"/_inference/{inference_id}",
17-
"methods":[
20+
"path": "/_inference/{inference_id}",
21+
"methods": [
1822
"PUT"
1923
],
20-
"parts":{
21-
"inference_id":{
22-
"type":"string",
23-
"description":"The inference Id"
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
2428
}
2529
}
2630
},
2731
{
28-
"path":"/_inference/{task_type}/{inference_id}",
29-
"methods":[
32+
"path": "/_inference/{task_type}/{inference_id}",
33+
"methods": [
3034
"PUT"
3135
],
32-
"parts":{
33-
"task_type":{
34-
"type":"string",
35-
"description":"The task type"
36+
"parts": {
37+
"task_type": {
38+
"type": "string",
39+
"description": "The task type"
3640
},
37-
"inference_id":{
38-
"type":"string",
39-
"description":"The inference Id"
41+
"inference_id": {
42+
"type": "string",
43+
"description": "The inference Id"
4044
}
4145
}
4246
}
4347
]
4448
},
45-
"body":{
46-
"description":"The inference endpoint's task and service settings"
49+
"body": {
50+
"description": "The inference endpoint's task and service settings"
4751
}
4852
}
4953
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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": [
11+
"application/json"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
16+
},
17+
"url": {
18+
"paths": [
19+
{
20+
"path": "/_inference/rerank/{inference_id}",
21+
"methods": [
22+
"POST"
23+
],
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
28+
}
29+
}
30+
}
31+
]
32+
},
33+
"body": {
34+
"description": "The inference payload"
35+
}
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"inference.sparse_embedding": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
5+
"description": "Perform sparse embedding inference"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"application/json"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
16+
},
17+
"url": {
18+
"paths": [
19+
{
20+
"path": "/_inference/sparse_embedding/{inference_id}",
21+
"methods": [
22+
"POST"
23+
],
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
28+
}
29+
}
30+
}
31+
]
32+
},
33+
"body": {
34+
"description": "The inference payload"
35+
}
36+
}
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"inference.stream_completion": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-stream-inference-api.html",
5+
"description": "Perform streaming inference"
6+
},
7+
"stability": "stable",
8+
"visibility": "public",
9+
"headers": {
10+
"accept": [
11+
"text/event-stream"
12+
],
13+
"content_type": [
14+
"application/json"
15+
]
16+
},
17+
"url": {
18+
"paths": [
19+
{
20+
"path": "/_inference/completion/{inference_id}/_stream",
21+
"methods": [
22+
"POST"
23+
],
24+
"parts": {
25+
"inference_id": {
26+
"type": "string",
27+
"description": "The inference Id"
28+
}
29+
}
30+
}
31+
]
32+
},
33+
"body": {
34+
"description": "The inference payload"
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)