AI-102 Question 283
Select 3You are developing a client application that needs to consume a pre-trained language model deployed in Azure. The application must send text input to the model and receive predictions in real-time. Which of the following steps are required to accomplish this?
- A
Obtain the API endpoint and key from the deployed Azure resource.
- B
Ensure the client application is hosted on Azure App Service.
- C
Send an HTTP POST request to the API endpoint with the required headers and payload.
- D
Install the Azure CLI on the client machine to interact with the language model.
- E
Parse the JSON response received from the API to extract prediction results.
Show answer and explanation
Correct answers: A, C, E
Explanation
To consume a language model deployed in Azure, the client application must interact with the model's API. This requires obtaining the API endpoint and key, sending a properly formatted HTTP POST request containing the input text, and parsing the JSON response to extract the prediction output. Hosting the client application on Azure or using the Azure CLI is not required for this process.
- A. Correct.
Correct. To interact with the deployed language model, you need the API endpoint and key provided by Azure during deployment.
- B. Incorrect.
Incorrect. While hosting the client application on Azure App Service could be a valid choice, it is not a mandatory step to consume the language model from a client application. The client application can run from anywhere with network access to the API.
- C. Correct.
Correct. To send input to the language model, an HTTP POST request with proper headers (like the API key) and a payload containing the text input is required.
- D. Incorrect.
Incorrect. Installing the Azure CLI is not necessary for consuming a language model from a client application. The Azure CLI is typically used for managing Azure resources, not for direct API consumption.
- E. Correct.
Correct. The response from the language model's API will be in JSON format, and you need to parse this JSON to extract the prediction results.