AI-102 exam dumps

AI-102 practice question 449 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 449

Select 3

You are designing an Azure AI solution to generate Python code snippets based on natural language prompts. You decide to use Azure OpenAI Service. Which steps should you include to ensure that the solution generates accurate and contextually appropriate code?

  1. A

    Select the Codex model from Azure OpenAI Service, as it is optimized for code generation.

  2. B

    Pre-train the Codex model with sample Python scripts from your organization before deployment.

  3. C

    Include clear and concise prompts that provide context and specify the desired output format.

  4. D

    Enable content filtering and response validation to ensure the generated code is secure and appropriate.

  5. E

    Use the Azure Cognitive Search service to preprocess prompts for better results.

Show answer and explanation

Correct answers: A, C, D

Explanation

To generate accurate and secure code snippets using Azure OpenAI Service, it is essential to use the Codex model, which is optimized for code-related tasks. Additionally, crafting clear prompts and implementing content filtering and response validation are key practices to ensure high-quality and secure outputs. Pre-training or preprocessing through unrelated services is not necessary in this context.

  • A. Correct.

    The Codex model is specifically designed for code generation tasks, making it the most suitable choice for this scenario.

  • B. Incorrect.

    Pre-training the Codex model is not necessary as it is already pre-trained with a vast amount of programming-related data. Fine-tuning may be an option but is not mandatory for initial deployment.

  • C. Correct.

    Providing clear and specific prompts improves the quality and relevance of the generated code, as the model relies on the context given in the input.

  • D. Correct.

    Content filtering and response validation are crucial to ensure that the generated code adheres to security and compliance standards, especially in sensitive or regulated environments.

  • E. Incorrect.

    Azure Cognitive Search is not relevant to this scenario as it is primarily used for search-related use cases, not for prompt preprocessing in Azure OpenAI Service.

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