AI-102 exam dumps

AI-102 practice question 462 of 493

Designing and Implementing a Microsoft Azure AI Solution. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AI-102 Question 462

Select 4

You are developing an Azure-based chatbot using the Azure OpenAI Service. The chatbot should leverage the GPT model to generate context-aware responses for user inputs. You need to submit a prompt to the Azure OpenAI API and receive a response efficiently. Which of the following steps should you include in your implementation to achieve this?

  1. A

    Authenticate to the Azure OpenAI API using an API key or Azure Active Directory token.

  2. B

    Send a POST request to the Azure OpenAI API's endpoint, specifying the model and input prompt in the request body.

  3. C

    Use the Azure CLI to directly query the OpenAI model without any API interaction.

  4. D

    Set the temperature parameter in the request body to control the randomness of the model's output.

  5. E

    Retrieve the response by parsing the JSON response payload returned by the API.

Show answer and explanation

Correct answers: A, B, D, E

Explanation

To use Azure OpenAI APIs effectively, you must authenticate using an API key or Azure Active Directory token and send a POST request to the appropriate endpoint, including necessary parameters like the model, input prompt, and optional configurations such as temperature. The response is returned in JSON format, which needs to be parsed to retrieve the output. The Azure CLI cannot directly query the OpenAI models, so it is not a valid step in this scenario.

  • A. Correct.

    Authentication is a required step when interacting with the Azure OpenAI API. Without proper authentication, the request will fail.

  • B. Correct.

    Submitting a POST request to the Azure OpenAI API's endpoint with the required parameters is essential to interact with the model and receive responses.

  • C. Incorrect.

    The Azure CLI cannot directly query the OpenAI model. API interaction is necessary for submitting prompts and retrieving responses.

  • D. Correct.

    The temperature parameter allows you to control the randomness of the model’s response, making it an important optional parameter in the request body.

  • E. Correct.

    The response from the Azure OpenAI API is returned in JSON format, which must be parsed to extract the model's generated output.

Timed practice exam

Take a AI-102 practice test under exam conditions

40 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam