Microsoft Azure AI Engineer Associate AI-102 Practice Question

You deploy an Azure OpenAI GPT-4 model inside an Azure AI Foundry project to extract information from customer comments. The model must return only valid JSON containing the keys "sentiment" and "keyPhrases", yet it occasionally adds a prose explanation before the JSON. Without adding any client-side post-processing, which prompt engineering change should you try first to make the output consistently valid?

  • Set the temperature parameter to 0 to make the model deterministic.

  • Increase the max_tokens value so the response never gets truncated.

  • Add a system message that declares the assistant is a JSON-only API and must output exactly the required object without extra text.

  • Provide additional few-shot examples that contrast correct and incorrect outputs.

Microsoft Azure AI Engineer Associate AI-102
Implement generative AI solutions
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot