Predictions for unstructured model deployments¶
Using the endpoint below, you can provide the data necessary to calculate predictions for a specific unstructured model deployment. If you need to make predictions for a standard model, see Predictions for deployments.
Endpoint: /deployments/<deploymentId>/predictionsUnstructured
Calculates predictions based on user-provided data for a specific unstructured model deployment. This endpoint works only for deployed custom inference models with an unstructured target type. For more information, see Assemble unstructured custom models.
This endpoint does the following:
-
Calls the
/predictUnstructured
route on the target custom inference model, allowing you to use the custom request and response schema, which may go beyond the standard DataRobot prediction API interface. -
Passes any payload and content type (MIME type and charset, if provided) to the model.
-
Passes any model-returned payload, along with the content type (MIME type and charset, if provided), back to the caller.
In the DRUM library, this call is handled by the score_unstructured()
hook.
Note
You can find the deployment ID in the sample code output of the Deployments > Predictions > Prediction API tab (with Interface set to API Client).
Request Method: POST
Request URL: deployed URL, for example: https://your-company.orm.datarobot.com/predApi/v1.0
Request parameters¶
Headers¶
Key | Description | Example(s) |
---|---|---|
Datarobot-key | Required for managed AI Platform users; string type Once a model is deployed, see the code snippet in the DataRobot UI, Predictions > Prediction API. |
DR-key-12345abcdb-xyz6789 |
Authorization | Required; string Three methods are supported:
|
|
Content-Type | Optional; string type Default: application/octet-stream Any provided content type is passed to the model; however, the DRUM library has a built-in decoding mechanism for text content-types using the specified charset. For more information, see Assemble unstructured custom models. |
|
Content-Encoding | Optional; string type Currently supports only gzip-encoding with the default data extension. |
gzip |
Accept | Optional; string type | */* (default) The response is defined by the model output. |
Query arguments¶
Currently not supported for the predictionsUnstructured
endpoint.
Body¶
Data | Type | Example(s) |
---|---|---|
Data to pass to the custom model | Bytes |
|
Response 200¶
The HTTP Response contains a payload returned by the custom model’s /predictUnstructured
route and passed back as-is. The Content-Type
header is passed to the caller. If the Content-Type
header isn't provided, the application/octet-stream
default is applied.
In the case of a DataRobot-acknowledged error in a request, an application/json
error message is returned.
In the DRUM library, the response payload and content type are generated by the score_unstructured()
hook.
Errors list¶
HTTP Code | Sample error message | Reason(s) |
---|---|---|
400 BAD REQUEST | {"message":"Query parameters not accepted on this endpoint"} |
The request passed query parameters to the endpoint. |
404 NOT FOUND | {"message": "Deployment :deploymentId cannot be found for user :userId"} |
The request provided an invalid :deploymentId (a deleted or non-existent deployment). |
422 UNPROCESSABLE CONTENT | {"message": "Only unstructured custom models can be used with this endpoint. Use /predictions instead.} |
The request provided a :deploymentId for a deployment that isn't an unstructured custom inference model deployment. |