hiexam
microsoft · AI-102 · Q673 · code_completion · azure, openai, code_completion

HOTSPOT - You have an Azure subscription that is linked to a Microsoft Entra tenant. The subscription ID is x1xx11x1-x…

HOTSPOT - You have an Azure subscription that is linked to a Microsoft Entra tenant. The subscription ID is x1xx11x1-x111-xxxx-xxxx-x1111xxx11x1 and the tenant ID is 1y1y1yyy-1y1y-y1y1-yy11-y1y1y11111y1. The subscription contains an Azure OpenAI resource named OpenAI1 that has a primary API key of 1111a111a11a111aaa11a1a1a11a11aa. OpenAI1 has a deployment named embeddings1 that uses the text-embedding-ada-002 model. You need to query OpenAI1 and retrieve embeddings for text input. How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point. //IMG//
Uri endpoint = new Uri("https://openai1.openai.azure.com");
AzureKeyCredential credentials = new AzureKeyCredential("{{slot1}}");

OpenAIClient openAIClient = new(endpoint, credentials);
EmbeddingsOptions embeddingOptions = new EmbeddingsOptions(input_text_string);
var returnValue = openAIClient.GetEmbeddings("{{slot2}}", embeddingOptions);

foreach (float item in returnValue.Value.Data[0].Embedding)
{
    Console.WriteLine(item);
}
Correct slot values

Answer hidden

Unlock AI-102

First 5 questions of every exam are free. Unlock the rest.

Includes
  • · All — questions
  • · Verified answers + AI explanations
  • · Spaced-repetition mistake notebook
  • · Phone, tablet, laptop sync

One-time payment. Doesn't auto-renew. · Already paid? Sign in