Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Passing multiple queries to Dataiku Endpoint for an exposed Prediction Model

vaibhav
Level 1
Passing multiple queries to Dataiku Endpoint for an exposed Prediction Model

Hello Team,

We have created an endpoint URL and have exposed our model in Dataiku for API testing , now we are able to send one transaction at a time and fetch predictions accordingly , but when i pass multiple transactions or say 2 at a time it gives me error -errorType":"com.dataiku.common.server.DKUControllerBase$MalformedRequestException","message":"Could not parse a SinglePredictionQuery from request body , when i searched about it it tells me that Dataiku endpoint is expecting a single prediction query but is receiving multiple queries. How can this be addressed as we have a requirement to pass bulk transactions with help of API at a time and model should predict accordingly.. Hope somebody helps out here..would be really helpful..

0 Kudos
5 Replies
Turribeach

What kind of API is it? You need to design your API to handle multiple values. For instance with a Python function API type you can have a parameter which is a series of queries to score. 

0 Kudos
vaibhav
Level 1
Author

Its the Rest API , ML model has been exposed with help of API service created in DataIKU and for same and endpoint was created and API key created for authorization. Within Dataiku on API designer page we are tying to run test queries for our ML prediction model through API and also through Postman and also we have tried using curl command through a VM , with all 3 ways for a single transaction it returns the prediction , however for 2 or more records/transaction payloads it gives the error mentioned in my initial post. How do we fix this to ensure that Dataiku responds to multiple/bulk queries fired at one shot.

0 Kudos

These are the types of APIs you can have. They are all REST APIs. Like I saidm if you create a Python API you can handle multiple values in a parameter very easily as you can decide to pass a JSON object inside a parameter and parse it in Python:

Screenshot 2024-05-15 at 17.30.41.png

0 Kudos
vaibhav
Level 1
Author

 we chose prediction model here as shown in the image shared by you, so based on my understanding we should chose Python Function here in Endpoint Type?

0 Kudos
vaibhav
Level 1
Author

Please let me know on the above point , also we are trying to use a for loop so it sends only 1 transaction at a time using curl command, will this also not work for prediction model API and consider all queries passed in loop as a single prediction query?

0 Kudos