StudyToCert

All certifications / Azure AI Engineer / Lessons

Microsoft Certified: Azure AI Engineer Associate AI-102 · Domain 2: Implement generative AI solutions

Chat completions: system, user and assistant messages, and calling a deployment with the Azure OpenAI SDK

▶ Watch the overview video

Last reviewed October 6, 2026 · Leer en español

Explain it simpler

A chat model works like a very capable assistant who has no memory at all. Each time you talk to it, you hand over a sheet of paper with the whole conversation written on it, and it writes the next reply at the bottom. The first lines on the sheet are the house rules, such as be polite and only talk about our products. Then come the things the customer said and the things the assistant said before. If you hand over a sheet with only the newest question, the assistant has no idea what came earlier. Your app is responsible for keeping the sheet and handing it over every time. Longer sheets take longer to read and cost more, so apps trim old lines.

It is 9:40 on a Monday and the help-desk queue at Ridgeline Outfitters is filling with the same complaint about the new support chatbot. Customers give their order number, ask a follow-up question, and the bot replies as if it has never heard of them. Priya, the developer who shipped it on Friday, opens the logs and sees every request reaching the model deployment successfully, with no errors and no throttling. The model is answering exactly what it was sent. So why does a model that seemed so clever in testing forget a customer the moment they say a second sentence?

Most generative AI apps on Azure are built on the chat completions API (application programming interface). Instead of sending one block of text, you send an ordered list of messages, and the model returns the next assistant message. Each message carries a role that tells the model who is speaking, and those roles are central to how you control behavior, so they show up again and again on the AI-102 exam.

Free account

Keep reading for free

Create a free StudyToCert account to read the rest of this lesson: 8 more sections, 6 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.

Sign up free Log in

Study Azure AI Engineer for free
A week-by-week plan with every lesson, quizzes, checkpoint tests, a practice exam and hands-on labs.
Open the Azure AI Engineer study plan