AI-102 Implement generative AI solutions Practice Question
You are building a conversational AI system using Azure OpenAI Service. The system must maintain context across multiple user turns. Which parameter determines how many previous messages are considered for the next response?
⚠ Common exam trap
It's easy for candidates to confuse parameters that control output generation (like `max_tokens`, `temperature`, or `top_p`) with the mechanism for maintaining conversation history, which is explicitly managed by the structure of the API call's `messages` array.
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
✓
The length of the messages array in the API call
The Azure OpenAI Service API uses a `messages` array in the request body to represent the conversation history. Each entry in this array corresponds to a previous turn (with roles like 'user', 'assistant', or 'system'), and the length of this array directly determines how many prior messages are considered when generating the next response. By including more messages, you extend the context window; by truncating the array, you limit it.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
max_tokens
Why it's wrong here
max_tokens limits the length of the model's response, not context.
- ✗
temperature
Why it's wrong here
Temperature controls randomness of output.
- ✗
top_p
Why it's wrong here
top_p is used for nucleus sampling, not context length.
- ✓
The length of the messages array in the API call
Why this is correct
The messages array holds conversation history; its length determines how many previous turns are included.
Go deeper
Related to this question
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 →
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.