...
Expand |
---|
title | API to infer from a model using provided dataset by reference |
---|
|
HTTP Request | Value |
---|
Method | POST GET
| Header | Authorization: Bearer {token}
| URL | {prefix}/models/{modelID}
| Query Parameters | {
"dbToken": "string";
"modelIDaction": "string", "data":{ "sourceType":"string", "endpoint":"string", "bearerToken":"string", "query":"string" } }
| Example | {
"dbToken": "D41C4A382C27A4B5DF824E2D4F148";
"modelIDaction": "6d4b571a-80ca-41ef-bc67-b158f4352ad8"infer", "data":{ "sourceType":"snowflake", "endpoint":"some/endpoint", "bearerToken":"7CA4D3C152646DDEFB527A958C45B", "query":"SELECT foo FROM bar WHERE baz" } }
|
|
Expand |
---|
|
HTTP Request | Value |
---|
Method | POST
|
Header | Authorization: Bearer {token}
|
URL | {prefix}/models/
|
Query Parameterstitle | API to infer from a model using provided dataset by value |
---|
| Pass by value is recommended only for small data set
200: Prediction returned successfully by reference |
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | { " | dbTokenresultStatus": " | stringready" | ;, "
| modelID":"string" "data"result":{ | "sourceType":" | stringsnowflake", | "endpoint":" | stringsome/endpoint", | "bearerToken":" | string7CA4D3C152646DDEFB527A958C45B",
| "query":" | stringSELECT * FROM resultTable" } } | Example | { "dbToken": "D41C4A382C27A4B5DF824E2D4F148"; "modelID":"6d4b571a-80ca-41ef-bc67-b158f4352ad8" |
|
Expand |
---|
title | API to infer from a model using provided dataset by value |
---|
|
Pass by value is recommended only for small data set HTTP Request | Value |
---|
Method | GET
| Header | Authorization: Bearer {token}
| URL | {prefix}/models/model/{modelID}
| Query Parameters | {
"action": "string", "data":{ "sourceType":"snowflakestring", "endpoint":"some/endpointstring", "bearerToken":"7CA4D3C152646DDEFB527A958C45Bstring", "query":"SELECT foo FROM bar WHERE bazstring" } }
| Example |
{
"action": "infer", "data":[ { "AccountBalance": 100, "YearOpened": 1990 }, { "AccountBalance": 200, "YearOpened": 1995 }, ] }
|
|
Expand |
---|
title | 200: Prediction returned successfully by value |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | { "resultStatus": "ready", "result":[ { "AccountBalance": 100, "YearOpened": 1990, "Churn": 80 }, { "AccountBalance": 200, "YearOpened": 1995, "Churn": 40 }, ] }
|
|
Expand |
---|
title | 200: Prediction is running and not ready yet |
---|
|
HTTP Response | Value |
---|
Header | Content-Type: application/json | Body | { "resultStatus": "notReady", "resultProgress": 50, "resultID": "925D2129FC57FAC5" } |
|
6. AI will connect to the underlying data source and run the prediction using the information provided by BI
7. In case the result cannot be returned immediately because of the prediction volume, BI can poll for the result.
In case of pass by reference
Code Block |
---|
language | js |
---|
firstline | 1 |
---|
title | GET {prefix}/results/925D2129FC57FAC5 |
---|
collapse | true |
---|
|
{
"resultStatus": "ready",
"result":{
"sourceType":"snowflake",
"endpoint":"some/endpoint",
"bearerToken":"7CA4D3C152646DDEFB527A958C45B",
"query":"SELECT * FROM resultTable"
}
} |
In case of pass by value:
Code Block |
---|
language | js |
---|
firstline | 1 |
---|
title | GET {prefix}/results/925D2129FC57FAC5 |
---|
collapse | true |
---|
|
{
"resultStatus": "ready",
"result":[
{
"AccountBalance": 100,
"YearOpened": 1990,
"Churn": 80
},
{
"AccountBalance": 200,
"YearOpened": 1995,
"Churn": 40
},
]
} |
Error - Apply to all API calls above
...