AI-102 Implement generative AI solutions

A nightly job feeds model output into a billing parser that crashes whenever a field is missing or renamed. Which prompt adjustment would most reduce these failures?

Show answer and explanation

Answer: A

Models follow a structured output format more reliably when the prompt states exactly which fields are required, what type each one takes, and which values are allowed. Those explicit constraints remove guesswork, so the parser receives a predictable shape. Pairing the prompt with a validator on the consuming side catches any remaining deviations before they break billing.

Why the other options are wrong

  • B. A friendly, varied style makes answers pleasant to read but increases format drift. Downstream code needs a stable shape, and this change does not provide one.
  • C. Higher temperature increases randomness in wording and structure. That makes parsing less reliable, not more consistent.
  • D. Examples are one of the strongest ways to show the expected format. Removing them leaves the model to improvise the shape of each response.

Exam tip. Describe the output schema in the prompt and validate the result in code, since prompts alone do not guarantee the shape.

Keep going. 175 AI-102 questions, answers explained after each one.

Practise this domain

Reviewed November 2026. Spotted a problem with this question? Report it from the practice tool.