Courseiva
Implement generative AI solutionsmediumMultiple ChoiceObjective-mapped

AI-102 Implement generative AI solutions Practice Question

A developer uses the Azure OpenAI API to generate code. They want to ensure that the generated code is in Python. Which parameter should they set?

⚠ Common exam trap

Microsoft often tests the distinction between parameters that control output randomness (temperature, top_p) and those that control output structure or behavior (system message), leading candidates to mistakenly choose temperature or top_p for language specification.

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

system message

The system message is used to set the behavior and context of the AI model, including specifying the desired output format or language. By setting the system message to 'You are a helpful assistant that always writes code in Python', the developer can instruct the model to generate Python code consistently. This parameter is part of the chat completions API and directly influences the model's persona and constraints.

Answer analysis

Option-by-option breakdown

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

  • temperature

    Why it's wrong here

    Temperature does not specify language.

  • top_p

    Why it's wrong here

    Top_p does not specify language.

  • system message

    Why this is correct

    System message can guide the model to output Python code.

  • max_tokens

    Why it's wrong here

    max_tokens does not specify language.

About these practice questions

This AI-102 question is part of Courseiva's 945-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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.