Courseiva

AI-102 Implement generative AI solutions Practice Question

A development team is building an Azure OpenAI chat application and wants the model to return structured JSON that matches a defined schema containing an 'intent' field and a 'confidence' field. The application will parse the response directly. Which deployment parameter should the team use to constrain the output format?

⚠ Common exam trap

Watch out — candidates often confuse determinism with structure: lowering temperature or raising max_tokens does not make a model emit schema-valid JSON.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Configure a structured output format, such as a JSON schema response format, on the request.

Constraining a model to emit machine-parseable JSON with specific fields is accomplished with structured outputs, where a JSON schema is supplied in the request's response format. This guarantees schema conformance far more reliably than sampling parameters or length limits, which only influence variability or truncation.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Set the 'temperature' parameter to 0.

    Why it's wrong here

    Temperature controls randomness, so a value of zero makes outputs more deterministic. However, deterministic text is not the same as schema-conformant JSON; the model can still emit prose, markdown fences, or extra keys. Because the application parses the response directly, temperature alone does not guarantee the required intent and confidence fields, so a structural constraint is still needed.

  • ✗

    Set the 'top_p' parameter to 1.

    Why it's wrong here

    Top_p is a nucleus sampling control that affects which tokens are considered during generation. Setting it to 1 includes the full distribution, which actually increases variability and does nothing to enforce a JSON schema. The application would still receive unconstrained text, so this parameter cannot ensure the presence or format of the intent and confidence fields.

  • ✓

    Configure a structured output format, such as a JSON schema response format, on the request.

    Why this is correct

    Structured outputs, exposed through the response format parameter with a JSON schema, constrain generation so the completion conforms to the supplied schema, including the required intent and confidence fields. This is the purpose-built mechanism for machine-parseable responses and removes the need for fragile prompt-only formatting instructions or post-processing repairs in the application.

  • ✗

    Increase the 'max_tokens' value to allow the full JSON document to be generated.

    Why it's wrong here

    Max_tokens only caps response length. Increasing it prevents truncation of a long JSON payload, but it does not force the model to produce valid JSON or the specified fields. A truncated response is one failure mode, yet schema violations and extra prose remain possible, so this setting cannot satisfy a parsing requirement on its own.

About these practice questions

This AI-102 question is part of Courseiva's 761-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.