AI-102 Implement generative AI solutions • Complete Question Bank
Complete AI-102 Implement generative AI solutions question bank — all 0 questions with answers and detailed explanations.
You are a machine learning engineer at a large retail company. The company has thousands of product descriptions that need to be updated regularly. They currently use a manual process. You propose using Azure OpenAI to generate new descriptions based on product attributes. You have a dataset of existing product descriptions and attributes stored in an Azure SQL Database. The solution must be cost-effective, scalable, and must not require retraining the model. You need to design the solution. You have the following options:
Option A: Use Azure OpenAI with few-shot learning by including examples in the prompt for each product. Deploy the model on an Azure Kubernetes Service (AKS) cluster for high throughput.
Option B: Use Azure OpenAI with prompt templates that include product attributes and call the API for each product. Use Azure Logic Apps to orchestrate the workflow and store results back to Azure SQL Database.
Option C: Fine-tune a custom model on the existing product descriptions and deploy it as a managed endpoint. Use Azure Data Factory to batch process all products.
Option D: Use Azure OpenAI with the batch API to generate descriptions for all products at once, using a single prompt that lists all products and attributes. Store the batch output in Azure Blob Storage and then import into Azure SQL Database.
Which option should you choose?
You are a cloud solution architect at a legal firm. The firm needs to automate the summarization of legal documents. They have a large corpus of past case summaries and legal documents stored in Azure Blob Storage. They want to use Azure OpenAI to generate summaries for new documents. The solution must ensure that the generated summaries are accurate and do not contain hallucinated legal facts. The firm also requires that the solution be serverless and minimize operational overhead. You need to design the solution.
Option A: Use Azure OpenAI with a system message that instructs the model to be accurate. Deploy the model as a web app on Azure App Service and call it from Azure Functions triggered by new blob uploads.
Option B: Use Azure OpenAI with Retrieval-Augmented Generation (RAG) by indexing the past case summaries in Azure AI Search. Use Azure Functions to process new documents, retrieve relevant cases, and pass them as context to the model. Store summaries in Azure Cosmos DB.
Option C: Fine-tune an Azure OpenAI model on the past case summaries and deploy it as a managed endpoint. Use Azure Logic Apps to trigger summarization when new blobs are added.
Option D: Use Azure OpenAI with the chat API and provide the entire document in the prompt. Use Azure Container Instances to run a service that calls the API and writes summaries back to Blob Storage.
Which option should you choose?
Refer to the exhibit.
```json
{
"role": "system",
"content": "You are an AI assistant that helps people find information. Provide concise answers with citations."
}
```
```json
{
"role": "user",
"content": "What is the capital of France?"
}
```
```json
{
"role": "assistant",
"content": "The capital of France is Paris [^1].",
"context": {
"citations": [
{
"content": "Paris is the capital and most populous city of France.",
"title": "Wikipedia",
"url": "https://en.wikipedia.org/wiki/Paris"
}
]
}
}
```Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
Extract text from images
Identify entities like people or organizations
Extract key phrases from text
Detect language of text
Determine sentiment of text
Drag a concept onto its matching description — or click a concept then click the description.
Custom client communication
Embedded chat in web pages
Integration with Teams
Integration with Slack
Integration with Facebook
Refer to the exhibit.
{
"completions": [
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "The capital of France is Paris.",
"role": "assistant"
}
}
],
"created": 1710000000,
"id": "cmpl-123abc",
"model": "gpt-4",
"object": "chat.completion",
"usage": {
"completion_tokens": 7,
"prompt_tokens": 10,
"total_tokens": 17
}
}
],
"object": "list"
}Refer to the exhibit.
$response = Invoke-RestMethod -Uri "https://myfoundry.openai.azure.com/openai/deployments/gpt-4/chat/completions?api-version=2024-02-15-preview" -Method Post -Headers @{
"Authorization" = "Bearer my-key"
} -Body (ConvertTo-Json @{
messages = @(
@{ role = "system"; content = "You are an AI assistant." },
@{ role = "user"; content = "Tell me a joke." }
)
max_tokens = 50
temperature = 0.7
})Refer to the exhibit.
{
"role": "system",
"content": "You are an AI assistant that helps users find information. When you don't know the answer, say 'I don't know' and do not make up information."
}Refer to the exhibit.
{
"completions": [
{
"index": 0,
"finish_reason": "content_filter",
"message": {
"role": "assistant",
"content": null
}
}
]
}Refer to the exhibit.
{
"role": "system",
"content": "You are a helpful assistant. Use the following sources to answer questions: [source1.pdf, source2.pdf]. If you cannot find the answer, say 'I don't know'."
}Refer to the exhibit.
{
"role": "system",
"content": "You are a helpful assistant that provides information about company policies. Only answer questions based on the provided context. If the answer is not in the context, say 'I do not know.'"
}Refer to the exhibit. temperature: 0.7 top_p: 0.9 max_tokens: 50 frequency_penalty: 0 presence_penalty: 0
{
"model": "gpt-4",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the capital of France?"}
],
"max_tokens": 500,
"temperature": 0.7,
"top_p": 0.95,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop": null
}{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
"displayName": "John Doe",
"userPrincipalName": "john.doe@contoso.com",
"businessPhones": [],
"mobilePhone": null,
"jobTitle": null,
"mail": null
}{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"cognitiveServiceName": {
"value": "my-ai-service"
},
"location": {
"value": "eastus"
},
"sku": {
"value": "S0"
},
"customSubDomainName": {
"value": "my-ai-service"
},
"networkAcls": {
"value": {
"defaultAction": "Deny",
"virtualNetworkRules": [],
"ipRules": []
}
}
}
}{
"role": "system",
"content": "You are an AI assistant that generates code. When asked to write code, always include comments explaining the code. If the user asks for something harmful, refuse and suggest an alternative."
}{
"completions": [
{
"prompt": "Generate a summary of the following text: ...",
"parameters": {
"temperature": 0.3,
"max_tokens": 150,
"top_p": 0.9,
"frequency_penalty": 0.0,
"presence_penalty": 0.0
},
"response": "..."
}
]
}{
"deployment": {
"model": "gpt-35-turbo",
"modelVersion": "0613",
"scaleSettings": {
"scaleType": "Standard"
},
"properties": {
"maxTokens": 4096,
"temperature": 0.7,
"topP": 0.95,
"frequencyPenalty": 0,
"presencePenalty": 0
}
}
}{
"resource": {
"name": "myOpenAI",
"location": "eastus",
"sku": {
"name": "S0"
},
"properties": {
"encryption": {
"keySource": "Microsoft.KeyVault",
"keyVaultProperties": {
"keyName": "myKey",
"keyVaultUri": "https://myvault.vault.azure.net/"
}
}
}
}
}Refer to the exhibit.
```json
{
"deployment": {
"model": "gpt-4",
"modelVersion": "0613",
"capacity": {
"type": "Provisioned",
"provisionedThroughput": 100
},
"scoringConfig": {
"temperature": 0.7,
"maxTokens": 2000,
"topP": 0.9,
"stop": ["\n"]
},
"contentFilter": {
"type": "Custom",
"customBlocklists": ["blocklist1"]
}
}
}
```Refer to the exhibit.
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2023-05-01",
"name": "myOpenAI",
"location": "eastus",
"sku": {
"name": "S0"
},
"kind": "OpenAI",
"properties": {
"customSubDomainName": "myopenai"
}
},
{
"type": "Microsoft.CognitiveServices/accounts/deployments",
"apiVersion": "2023-05-01",
"name": "myOpenAI/gpt-35-turbo",
"dependsOn": [
"[resourceId('Microsoft.CognitiveServices/accounts', 'myOpenAI')]"
],
"sku": {
"name": "Standard",
"capacity": 100
},
"properties": {
"model": {
"format": "OpenAI",
"name": "gpt-35-turbo",
"version": "0613"
},
"raiPolicyName": "MyPolicy"
}
}
]
}
```Refer to the exhibit. ``` $deployment = Get-AzCognitiveServicesAccountDeployment -ResourceGroupName "myRG" -AccountName "myOpenAI" -Name "gpt35" $deployment.Properties.RaiPolicyName ``` Output: "MyPolicy"
Refer to the exhibit. {
"deploymentName": "gpt-4",
"model": {
"format": "OpenAI",
"name": "gpt-4",
"version": "0613"
},
"scaleSettings": {
"scaleType": "Standard"
}
}Refer to the exhibit. {
"type": "Microsoft.MachineLearningServices/workspaces/onlineEndpoints/deployments",
"apiVersion": "2023-04-01-preview",
"name": "deploy-gen-model",
"location": "eastus",
"properties": {
"model": {
"assetId": "/subscriptions/.../models/gen-model/versions/1"
},
"requestSettings": {
"requestTimeout": "PT30S",
"maxConcurrentRequestsPerInstance": 10
},
"environmentVariables": {
"MODEL_CACHE_SIZE": "10"
},
"scaleSettings": {
"scaleType": "Manual",
"instanceCount": 2
}
}
}{
"completions": [
{
"prompt": "Generate a summary for the meeting notes: {notes}",
"max_tokens": 150,
"temperature": 0.7,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"stop": null
}
]
}You are a senior AI engineer at a financial services company. You are building a generative AI solution to assist financial advisors with client portfolio recommendations. The solution must use Azure OpenAI Service. The following requirements must be met:
1. Responses must be based on the latest market data and client profiles stored in Azure SQL Database. 2. The solution must not generate investment advice that is not backed by the data. 3. The solution must be cost-effective and minimize API calls. 4. The system must provide citations for the data used in the response.
You design a RAG pattern with Azure AI Search indexing the portfolio data. You also implement a system message instructing the model to only use provided context. However, the model occasionally generates advice that contradicts the data or invents new facts. You need to modify the solution to ensure responses are strictly grounded in the retrieved data. What should you do?
Refer to the exhibit.
{
"content_filters": [
{
"type": "hate",
"action": "block",
"severity": "high"
},
{
"type": "sexual",
"action": "block",
"severity": "medium"
},
{
"type": "self_harm",
"action": "block",
"severity": "low"
}
]
}You deploy an Azure OpenAI model with the above content filter configuration. A user submits a prompt that the system rates as "hate" at severity level "medium". What happens?