...
- We understand that there are 2 key steps in machine learning - Model Training and Result Inference. In this first release of this protocol, we will only focus on inference. Training is provided here but it's subjected to more discussion.
Overall Flow
Image Added
REST APIs
All of the REST APIs call presented below use bearer tokens for authorization. The {prefix} of each API is configurable in the hosted servers. This protocol is inspired by Delta Sharing.
List Models - Step (1)
HTTP Request | Value |
---|
Method | GET
|
Header | Authorization: Bearer {token}
|
URL | {prefix}/models/{model}
|
Query Parameters | maxResults (type: Int32, optional): The maximum number of results per page that should be returned. If the number of available results is larger than maxResult , the response will provide a nextPageToken that can be used to get the next page of results in subsequent list requests. The server may return fewer than maxResults items even if there are more available. The client should check nextPageToken in the response to determine if there are more available. Must be non-negative. 0 will return no results but nextPageToken may be populated. pageToken (type: String, optional): Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. nextPageToken will not be returned in a response if there are no more results available. |
Example:
Code Block |
---|
language | js |
---|
firstline | 1 |
---|
title | GET {prefix}/models?maxResults=5 |
---|
collapse | true |
---|
|
{
"items": [
{
"name": "Model 1",
"id": "6d4b571a-80ca-41ef-bc67-b158f4352ad8"
},
{
"name": "Model 2",
"id": "70d9ab9d-9a64-49a8-be4d-d3a678b4ab16"
},
{
"name": "Model 3",
"id": "99914a97-5d2e-4b9f-b81a-1d43c9409162"
},
{
"name": "Model 4",
"id": "8295bfda-7901-43e8-9d31-81fd1c3210ee"
},
{
"name": "Model 5",
"id": "0693c224-3a3f-4fe7-bbbe-c70f93d15f12"
}
],
"nextPageToken": "3xXc4ZAsqZQwgejt"
} |
Error - Apple to all API calls above
Expand |
---|
title | 400: The request is malformed |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | {
"errorCode": "string",
"message": "string"
} |
|
Expand |
---|
title | 401: The request is unauthenticated. The bearer token is missing or incorrect |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | {
"errorCode": "string",
"message": "string"
} |
|
Expand |
---|
title | 403: The request is forbidden from being fulfilled |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | {
"errorCode": "string",
"message": "string"
} |
|
Expand |
---|
title | 500: The request is not handled correctly due to a server error |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | {
"errorCode": "string",
"message": "string"
} |
|
Authors
Future Enhancement
- Define data pipeline to transform data before running
- Containerized Model so that prediction can run in BI instead of in AI
- nextPageToken format
References
...