Skip to Content

AI-102: What Are the Steps to Submit Prompts Using Azure OpenAI REST API?

Discover the correct steps to submit prompts and generate natural language responses with Azure OpenAI REST API. A must-know guide for passing the AI-102 certification exam.

Table of Contents

Question

Your organization, Xerigon Corporation, is developing a virtual assistant that can assist users by generating natural language responses to queries about the company’s services. The virtual assistant is powered by Azure OpenAI and needs to handle user prompts effectively to provide accurate and context-aware answers.

You have configured the Azure OpenAI resource and now want to implement a solution where the assistant can generate text based on specific prompts submitted by users.

Which of the following steps should you take to submit prompts and generate natural language responses in your application?

A. Train a custom OpenAI model for each user query.
B. Use Azure Cognitive Search to index prompts and generate responses.
C. Implement a prebuilt speech to text model to convert user queries before submitting prompts.
D. Use the Azure OpenAI REST API to submit prompts and receive responses in your application.

Answer

D. Use the Azure OpenAI REST API to submit prompts and receive responses in your application.

Explanation

You would use the Azure OpenAI REST API to submit prompts and receive responses in your application. The Azure OpenAI REST API allows you to submit prompts to a pretrained generative model (such as GPT) and receive natural language responses. This is the most efficient and straightforward method for integrating generative AI capabilities into your application. You can customize prompts to provide context and ensure the responses meet your business needs.

After deploying the model, you can test how it responds to prompts. A prompt is the text input sent to the model’s completions endpoint. The model’s outputs, known as completions, can be in the form of text, code, or other formats.

You would not train a custom OpenAI model for each user query in the given scenario. Training a custom model for every query is inefficient and not recommended for handling dynamic user inputs. Training custom models can be useful for domain-specific needs but is unnecessary for basic prompt-based natural language generation.

You would not implement a prebuilt speech to text model to convert user queries before submitting prompts in the given scenario. Speech to text models are useful for converting spoken queries into text which can then be submitted as prompts. However, this step is optional and specific to voice-based applications. It is not a core requirement for submitting prompts for natural language generation.

You would not use Azure Cognitive Search to index prompts and generate responses in the given scenario. Azure Cognitive Search is designed for indexing and querying structured or semi-structured data. It does not provide capabilities for generating natural language responses based on prompts.

Microsoft Azure AI Engineer Associate AI-102 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Azure AI Engineer Associate AI-102 exam and earn Microsoft Azure AI Engineer Associate AI-102 certification.