I want to use my deployed azure language studio model in a website.

Muhammad Qasim 41 Reputation points
2023-03-14T18:08:18.35+00:00

I have trained my custom text classification model on azure language studio and also deployment it but when I want to send curl request to it from cmd then it gives below error. I have used get prediction URL method to query my model. How can I solve this error?

{​"error":{​"code":"InvalidRequest","message":"Invalid Request.","innererror":{​"code":"EmptyRequest","message":"Request body must be present."}​}​}​

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,371 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 41,961 Reputation points Microsoft Employee
    2023-03-15T10:20:27.3666667+00:00

    Muhammad Qasim I think your request is missing the body section or is incorrectly formatted. Are you using a custom question answering KB deployment prediction URL? In that case, you can use the Get Prediction URL button to copy the curl request and then use the same.

    User's image

    For example, I have used this option to copy the curl request and run the same with minimal parameters.

    curl -X POST "https://<your_resource>.cognitiveservices.azure.com/language/:query-knowledgebases?projectName=<project_name>&api-version=2021-10-01&deploymentName=production" -H "Ocp-Apim-Subscription-Key: <your_key>" -H "Content-Type: application/json" -d "{\"top\":3,\"question\":\"This is test\",\"includeUnstructuredSources\":true,\"confidenceScoreThreshold\":\"0.4\",\"answerSpanRequest\":{\"enable\":true,\"topAnswersWithSpan\":1}}}"

    User's image

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful