Skip to content

Commit 6ba25e2

Browse files
authored
chore(specs): setup revised predict model spec (#1045)
1 parent ab8ba89 commit 6ba25e2

File tree

5 files changed

+33
-27
lines changed

5 files changed

+33
-27
lines changed

specs/predict/common/schemas/modelsParams.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ activateModelParams:
99
$ref: '#/sourceID'
1010
index:
1111
$ref: '#/index'
12-
affinities:
12+
modelAttributes:
1313
type: array
1414
items:
15-
$ref: '#/affinities'
15+
$ref: '#/modelAttributes'
1616
contentAttributes:
1717
type: array
1818
items:
@@ -28,20 +28,16 @@ updateModelParams:
2828
properties:
2929
name:
3030
$ref: '#/name'
31-
affinities:
31+
modelAttributes:
3232
type: array
3333
items:
34-
$ref: '#/affinities'
34+
$ref: '#/modelAttributes'
3535
contentAttributes:
3636
type: array
3737
items:
3838
$ref: '#/contentAttributes'
39-
status:
40-
$ref: '#/status'
41-
required:
42-
- modelID
43-
- sourceID
44-
- index
39+
modelStatus:
40+
$ref: '#/modelStatus'
4541

4642
type:
4743
type: string
@@ -60,15 +56,15 @@ index:
6056
type: string
6157
description: The index name.
6258

63-
affinities:
59+
modelAttributes:
6460
type: string
65-
description: List of items attributes that will be used as affinities. This param is required if `type=affinities`.
61+
description: List of items attributes that will be used in the model. This param is required if the model `type` needs it (e.g. `affinities`, `funnel_stage`).
6662

6763
contentAttributes:
6864
type: string
6965
description: List of items attributes that will be used for embeddings, for ex. titles or descriptions.
7066

71-
status:
67+
modelStatus:
7268
type: string
7369
enum: [active, inactive]
7470
description: |

specs/predict/paths/models/models.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ post:
2828
summary: Activate a model instance.
2929
description: >
3030
Activate an existing model template. This action triggers the training and inference pipelines for the selected model.
31-
The model is added with `status=pending`.
31+
The model is added with `modelStatus=pending`.
3232
If a model with the exact same source & index already exists, the API endpoint returns an error.
3333
requestBody:
3434
required: true

specs/predict/responses/Models.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ modelInstance:
1515
type: string
1616
index:
1717
type: string
18-
affinities:
19-
type: array
20-
items:
21-
type: string
22-
description: Affinities within this model instance.
18+
modelAttributes:
19+
$ref: '#/modelAttributes'
2320
contentAttributes:
2421
type: array
2522
items:
@@ -41,11 +38,11 @@ modelInstance:
4138
- type
4239
- sourceID
4340
- index
44-
- affinities
41+
- modelAttributes
4542
- contentAttributes
4643
- lastTrained
4744
- lastInference
48-
- status
45+
- modelStatus
4946

5047
getModelInstanceConfigStatus:
5148
type: string
@@ -77,3 +74,16 @@ modelMetrics:
7774
format: double
7875
updatedAt:
7976
$ref: '../../common/responses/common.yml#/updatedAt'
77+
78+
modelAttributes:
79+
type: object
80+
additionalProperties: false
81+
properties:
82+
name:
83+
type: string
84+
values:
85+
type: array
86+
items:
87+
type: string
88+
required:
89+
- name

tests/CTS/methods/requests/predict/activateModelInstance.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "Shopping stage for EU users",
77
"sourceID": "0200030-129930",
88
"index": "Products Production",
9-
"affinities": [],
9+
"modelAttributes": [],
1010
"contentAttributes": [
1111
"title",
1212
"description"
@@ -20,7 +20,7 @@
2020
"name": "Shopping stage for EU users",
2121
"sourceID": "0200030-129930",
2222
"index": "Products Production",
23-
"affinities": [],
23+
"modelAttributes": [],
2424
"contentAttributes": [
2525
"title",
2626
"description"

tests/CTS/methods/requests/predict/updateModelInstance.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"modelID": "model1",
66
"updateModelParams": {
77
"name": "Shopping stage for EU users",
8-
"affinities": [
8+
"modelAttributes": [
99
"brand",
1010
"color",
1111
"category_level0",
@@ -15,15 +15,15 @@
1515
"title",
1616
"description"
1717
],
18-
"status": "inactive"
18+
"modelStatus": "inactive"
1919
}
2020
},
2121
"request": {
2222
"path": "/1/predict/models/model1",
2323
"method": "POST",
2424
"body": {
2525
"name": "Shopping stage for EU users",
26-
"affinities": [
26+
"modelAttributes": [
2727
"brand",
2828
"color",
2929
"category_level0",
@@ -33,7 +33,7 @@
3333
"title",
3434
"description"
3535
],
36-
"status": "inactive"
36+
"modelStatus": "inactive"
3737
}
3838
}
3939
}

0 commit comments

Comments
 (0)