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
Watch out — candidates often confuse parameters that control randomness (temperature, top_p) or response length (max_tokens) with the system message, which is the correct mechanism for setting output language or format constraints.
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 parameter in the Azure OpenAI API is used to set the behavior and context of the assistant, including specifying the desired output format or language. By setting the system message to something like 'You are a helpful assistant that always generates Python code,' the developer can instruct the model to produce Python code consistently. This is the correct parameter for guiding the model's response style and content.
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.
- ✗
max_tokens
Why it's wrong here
max_tokens does not specify language.
- ✓
system message
Why this is correct
System message can guide the model to output Python code.
- ✗
top_p
Why it's wrong here
Top_p does not specify language.
Go deeper
Related to this question
About these practice questions
Courseiva writes every AI-102 question from scratch — 945 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
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.