Passing multiple queries to Dataiku Endpoint for an exposed Prediction Model

vaibhav
vaibhav Registered Posts: 5

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..

Answers

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron

    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.

  • vaibhav
    vaibhav Registered Posts: 5

    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.

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,160 Neuron

    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

  • vaibhav
    vaibhav Registered Posts: 5

    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?

  • vaibhav
    vaibhav Registered Posts: 5

    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?

Setup Info
    Tags
      Help me…