‹ All AI-103 questions

AI-103 Practice Question 54: Streaming Chat Completions

Microsoft Azure AI Apps and Agents Developer Associate (AI-103) · Test 6 · question 4 of 10

Implement generative AI and agentic solutionseasy

A support chat widget calls a chat completions endpoint and waits for the entire answer before showing anything. Longer answers leave the widget blank for several seconds, and users assume it has frozen. The team wants the widget to display words as the model produces them, without splitting the work into a separate background job.

What should they change on the request?

Select one answer
Show answer and explanation

Answer:

  • D. Set stream to true and render each incoming content chunk as it arrives

Setting stream: true switches the response to server-sent events: instead of one payload returned after the whole completion is generated, the service sends a series of chat.completion.chunk messages, each carrying a small piece of the answer in choices[0].delta.content, as soon as that piece exists. Microsoft's own description of this behavior is that customers "receive content from the API when it's generated, instead of waiting for" the full response, exactly the token-by-token rendering the widget needs, with finish_reason staying null until the final chunk.

- A is wrong because it trades away answer length to reduce total wait time; the widget still shows nothing until the (now shorter) full response is ready; it doesn't produce incremental rendering. - B is wrong because a longer client timeout only postpones when the client gives up on a slow request; it has no effect on when content becomes visible to the user. - C is wrong because that's the polling pattern for asynchronous batch-style jobs. Chat completions is a synchronous call; there's no separate job status to poll, and polling wouldn't produce a smooth per-token render even if there were.

Reference: Content streaming in Azure OpenAI

Practice Test 6 ›

Study guides for AI-103

AI engineer roadmap 2026: skills, certs and the orderAI engineer roadmap for 2026: skills to learn in order, AI engineer vs ML engineer, which certifications fit each stage, and what to skip.
AI-200 exam guide: Azure AI Cloud Developer AssociateAI-200 replaced AZ-204: what the Azure AI Cloud Developer exam tests, how it differs from AI-103, price in USD and INR, format and how to prepare.
How AI Is Changing Software Jobs: Where to PrepareHow AI is changing software jobs: what history shows, the evidence on junior developers, what Klarna learned, new AI roles and five domains to prepare for.
AI-901 exam guide: Azure AI Fundamentals after AI-900AI-901 replaced AI-900: learn what changed, how much Python and Microsoft Foundry you need, exam costs in India, and how to prepare.
Best AI certifications 2026: AWS, Google, Microsoft, ClaudeThe best AI certifications in 2026 from AWS, Google, Microsoft, Claude and Databricks, by level, with price, status and which one to take first.
Microsoft AI certification path 2026: which exam firstMicrosoft AI certification path for 2026 - AI-901, AB-730, AI-103, AI-200, AI-300, AB-100, AI-500 and GH-300 by role, and which exam to take first.
AI-103 Certification Guide: What Changed From AI-102The AI-103 certification replaced AI-102 in 2026. Exam format, cost, the five skill domains, what changed and how to prepare, with free practice questions.
What Is RAG? How Retrieval-Augmented Generation WorksWhat RAG is and how it works: chunking, embeddings, vector search, hybrid search, reranking, GraphRAG and agentic RAG on AWS, Google and Azure.
Prompt engineering vs RAG vs fine-tuningWhen to use prompt engineering, retrieval-augmented generation, fine-tuning or continued pre-training, compared on cost, freshness, hallucination and privacy.