-
Notifications
You must be signed in to change notification settings - Fork 21
feat(specs): predict model endpoints #1014
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e31a1d2
feat: add list modeltypes endpoint
writeens 149c1e7
fix:update model endpoint tests
writeens 4cd6b08
feat: add get model instance configuration endpoint
writeens e65f2e1
feat: add list model instance endpoint
writeens 4579960
feat: add activate model instance endpoint
writeens 650930a
feat: add update model instance endpoint
writeens 700f3da
feat: add delete model instance endpoint
writeens 9658ea3
feat: add get model instance metrics endpoint
writeens ac9f009
Merge branch 'main' into feat/predict-model-endpoints
writeens 226590f
fix(specs): fix specs across predict model endpoints
writeens 947fabc
fix(specs): fix specs across predict model endpoints
writeens 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
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
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,76 @@ | ||
activateModelParams: | ||
type: object | ||
properties: | ||
type: | ||
$ref: '../../common/schemas/Params.yml#/modelsToRetrieve' | ||
name: | ||
$ref: '#/name' | ||
sourceID: | ||
$ref: '#/sourceID' | ||
index: | ||
$ref: '#/index' | ||
affinities: | ||
type: array | ||
items: | ||
$ref: '#/affinities' | ||
contentAttributes: | ||
type: array | ||
items: | ||
$ref: '#/contentAttributes' | ||
required: | ||
- type | ||
- name | ||
- sourceID | ||
- index | ||
|
||
updateModelParams: | ||
type: object | ||
properties: | ||
name: | ||
$ref: '#/name' | ||
affinities: | ||
type: array | ||
items: | ||
$ref: '#/affinities' | ||
contentAttributes: | ||
type: array | ||
items: | ||
$ref: '#/contentAttributes' | ||
status: | ||
$ref: '#/status' | ||
required: | ||
- modelID | ||
- sourceID | ||
- index | ||
|
||
type: | ||
type: string | ||
enum: ['funnel_stage', 'order_value', 'affinities'] | ||
description: The model's type. | ||
|
||
name: | ||
type: string | ||
description: The model’s instance name. | ||
|
||
sourceID: | ||
type: string | ||
description: The data source ID, as returned by the (external) sources API. | ||
|
||
index: | ||
type: string | ||
description: The index name. | ||
|
||
affinities: | ||
type: string | ||
description: List of items attributes that will be used as affinities. This param is required if `type=affinities`. | ||
|
||
contentAttributes: | ||
type: string | ||
description: List of items attributes that will be used for embeddings, for ex. titles or descriptions. | ||
|
||
status: | ||
type: string | ||
enum: [active, inactive] | ||
description: | | ||
`active` - model is running and generating predictions. The active value is allowed only if the current status of the model is `inactive`. \ | ||
`inactive` - model training and inference have been paused. The inactive value is allowed only if the current status of the model is `active`. |
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,53 @@ | ||
get: | ||
tags: | ||
- models | ||
operationId: getAvailableModelTypes | ||
summary: Get a list of available model types. | ||
description: Get a list of all available model types. Each model type can be activated more than once, by selecting a different data source. | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: getAvailableModelTypesResponse | ||
type: array | ||
items: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
name: | ||
type: string | ||
description: Name of the model. | ||
type: | ||
type: string | ||
description: Description of the model. | ||
compatibleSources: | ||
type: array | ||
items: | ||
type: string | ||
$ref: '../../responses/ModelTypes.yml#/compatibleSources' | ||
dataRequirements: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
minUsers: | ||
type: integer | ||
description: Minimum number of users required for this model. | ||
minDays: | ||
type: integer | ||
description: Minimum number of days model needs to run. | ||
required: | ||
- minUsers | ||
- minDays | ||
required: | ||
- name | ||
- type | ||
- compatibleSources | ||
- dataRequirements | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' |
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,26 @@ | ||
get: | ||
tags: | ||
- models | ||
operationId: getModelMetrics | ||
summary: Get a model’s instance metrics. | ||
description: Get the model instance’ training metrics. | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/modelID' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: getModelMetricsResponse | ||
type: array | ||
items: | ||
$ref: '../../responses/Models.yml#/modelMetrics' | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'404': | ||
$ref: '../../../common/responses/IndexNotFound.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' |
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,101 @@ | ||
get: | ||
tags: | ||
- models | ||
operationId: getModelInstanceConfig | ||
summary: Get a model’s instance configuration. | ||
description: Get the configuration for a model that was activated. | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/modelID' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: getModelInstanceConfigResponse | ||
writeens marked this conversation as resolved.
Show resolved
Hide resolved
|
||
$ref: '../../responses/Models.yml#/modelInstance' | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'404': | ||
$ref: '../../../common/responses/IndexNotFound.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' | ||
|
||
post: | ||
tags: | ||
- models | ||
operationId: updateModelInstance | ||
summary: Update a model instance. | ||
description: Update a model’s configuration. | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/modelID' | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/modelsParams.yml#/updateModelParams' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: updateModelInstanceResponse | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
modelID: | ||
type: string | ||
description: The ID of the model. | ||
updatedAt: | ||
$ref: '../../../common/responses/common.yml#/updatedAt' | ||
required: | ||
- modelID | ||
- updatedAt | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'404': | ||
$ref: '../../../common/responses/IndexNotFound.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' | ||
|
||
delete: | ||
tags: | ||
- models | ||
operationId: deleteModelInstance | ||
summary: Delete a model instance. | ||
description: Delete the model’s configuration, pipelines and generated predictions. | ||
parameters: | ||
- $ref: '../../common/parameters.yml#/modelID' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: deleteModelInstanceResponse | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
modelID: | ||
type: string | ||
description: The ID of the model. | ||
deletedUntil: | ||
type: string | ||
description: The date until which you can safely consider the data as being deleted. | ||
required: | ||
- modelID | ||
- deletedUntil | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'404': | ||
$ref: '../../../common/responses/IndexNotFound.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' |
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,63 @@ | ||
get: | ||
tags: | ||
- models | ||
operationId: getModelInstances | ||
summary: Get model instances. | ||
description: Get a list of all model instances. | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: getModelInstancesResponse | ||
type: array | ||
items: | ||
$ref: '../../responses/Models.yml#/modelInstance' | ||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' | ||
|
||
post: | ||
tags: | ||
- models | ||
operationId: activateModelInstance | ||
summary: Activate a model instance. | ||
description: > | ||
Activate an existing model template. This action triggers the training and inference pipelines for the selected model. | ||
The model is added with `status=pending`. | ||
If a model with the exact same source & index already exists, the API endpoint returns an error. | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../common/schemas/modelsParams.yml#/activateModelParams' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: activateModelInstanceResponse | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
modelID: | ||
type: string | ||
description: The ID of the model. | ||
updatedAt: | ||
$ref: '../../../common/responses/common.yml#/updatedAt' | ||
required: | ||
- modelID | ||
- updatedAt | ||
|
||
'401': | ||
$ref: '../../responses/InvalidCredentials.yml' | ||
'422': | ||
$ref: '../../../common/responses/UnprocessableEntity.yml' | ||
'500': | ||
$ref: '../../../common/responses/InternalError.yml' |
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,3 @@ | ||
compatibleSources: | ||
type: string | ||
enum: [bigquery] |
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.
Uh oh!
There was an error while loading. Please reload this page.