Skip to content

Commit 1be098a

Browse files
[ML] Add spec files for Llama and AI21 (elastic#132724)
* Adding missing specs * Update rest-api-spec schema to accept digits --------- Co-authored-by: Sylvain Wallez <[email protected]>
1 parent 15ae296 commit 1be098a

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"inference.put_ai21": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-ai21.html",
5+
"description": "Configure a AI21 inference endpoint"
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/{task_type}/{ai21_inference_id}",
17+
"methods": ["PUT"],
18+
"parts": {
19+
"task_type": {
20+
"type": "string",
21+
"description": "The task type"
22+
},
23+
"ai21_inference_id": {
24+
"type": "string",
25+
"description": "The inference ID"
26+
}
27+
}
28+
}
29+
]
30+
},
31+
"body": {
32+
"description": "The inference endpoint's task and service settings"
33+
}
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"inference.put_llama": {
3+
"documentation": {
4+
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-llama.html",
5+
"description": "Configure a Llama inference endpoint"
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/{task_type}/{llama_inference_id}",
17+
"methods": ["PUT"],
18+
"parts": {
19+
"task_type": {
20+
"type": "string",
21+
"description": "The task type"
22+
},
23+
"llama_inference_id": {
24+
"type": "string",
25+
"description": "The inference ID"
26+
}
27+
}
28+
}
29+
]
30+
},
31+
"body": {
32+
"description": "The inference endpoint's task and service settings"
33+
}
34+
}
35+
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"Api": {
77
"type": "object",
88
"propertyNames": {
9-
"pattern": "^(?:[a-z]+?(_[a-z]+)*(\\.[a-z]+?(_[a-z]+)*)?|_internal\\.[a-z]+?(_[a-z]+)*)$"
9+
"pattern": "^(?:[a-z][a-z0-9]*?(_[a-z0-9]+)*(\\.[a-z][a-z0-9]*?(_[a-z0-9]+)*)?|_internal\\.[a-z][a-z0-9]*?(_[a-z0-9]+)*)$"
1010
},
1111
"minProperties": 1,
1212
"maxProperties": 1,
1313
"patternProperties": {
14-
"^(?:[a-z]+?(_[a-z]+)*(\\.[a-z]+?(_[a-z]+)*)?|_internal\\.[a-z]+?(_[a-z]+)*)$": {
14+
"^(?:[a-z][a-z0-9]*?(_[a-z0-9]+)*(\\.[a-z][a-z0-9]*?(_[a-z0-9]+)*)?|_internal\\.[a-z][a-z0-9]*?(_[a-z0-9]+)*)$": {
1515
"$ref": "#/definitions/Components"
1616
}
1717
},
@@ -135,10 +135,10 @@
135135
"type": "object",
136136
"additionalProperties": true,
137137
"propertyNames": {
138-
"pattern": "^_?[a-z]+?(_[a-z]+)*$"
138+
"pattern": "^_?[a-z][a-z0-9]*?(_[a-z0-9]+)*$"
139139
},
140140
"patternProperties": {
141-
"^_?[a-z]+?(_[a-z]+)*$": {
141+
"^_?[a-z][a-z0-9]*?(_[a-z0-9]+)*$": {
142142
"$ref": "#/definitions/ParamPart"
143143
}
144144
},
@@ -232,10 +232,10 @@
232232
"type": "object",
233233
"additionalProperties": true,
234234
"propertyNames": {
235-
"pattern": "^_?[a-z]+?(_[a-z]+)*$"
235+
"pattern": "^_?[a-z][a-z0-9]*?(_[a-z0-9]+)*$"
236236
},
237237
"patternProperties": {
238-
"^_?[a-z]+?(_[a-z]+)*$": {
238+
"^_?[a-z][a-z0-9]*?(_[a-z0-9]+)*$": {
239239
"$ref": "#/definitions/ParamPart"
240240
}
241241
},

0 commit comments

Comments
 (0)