Write your response in your own notes, then compare it with the sample answer. This practice is separate from the scored exam and does not affect your certificate.
Practice 1
Sketch the request path for a visitor message. Label which component holds the provider key, system prompt and limits, and explain why the key does not belong in the browser.
Check your answer against these points:
- Shows the browser, server function and model API in the right order.
- Places the key, prompt and limits in the function.
- Explains that browser code can be inspected.
Compare with a sample answer
The browser sends the visitor message to the site’s server function. The function holds the key from its environment, adds the system prompt and limits, then calls the model API and returns a reply. The browser code is public and can be inspected, so the key stays in the function.
The source describes the browser to function to model path and assigns key, prompt and limits to the function.
Practice 2
Write a short cost-control plan for a public chat endpoint. Include one per-visitor control, a reply or daily cap, an alert, and the message shown when a limit is reached.
Check your answer against these points:
- Includes a per-visitor rate limit.
- Includes a reply or daily cost cap.
- Includes an alert.
- Provides a clear visitor-facing limit message.
Compare with a sample answer
Limit messages per visitor over a time window. Cap reply length and set a daily site cap with alerts. When a visitor limit is reached, return a clear wait message and use the site fallback if the daily cap turns the bot off.
The course covers visitor rate limits, reply caps, daily caps, alerts and a friendly limit message.
Practice 3
Review the illustrative function and describe what it checks before calling the model. Include the purpose and limit of its Origin check.
Check your answer against these points:
- Names at least three checks made by the function.
- Says validation and limits run server-side.
- Explains that Origin is a filter and can be faked by a script.
Compare with a sample answer
It handles OPTIONS, accepts only POST, checks the kill switch and compares Origin with the configured site. It applies rate limiting and validates the message list before forwarding only message roles and text with the function’s own system prompt. The Origin check is a filter, not a lock, because a non-browser script can call the endpoint and fake the header.
The function example applies method, origin, kill-switch, rate and body checks; the accompanying text warns that a script can fake Origin, so it is not endpoint authentication.
Practice 4
Draft a brief notice outline for the chat box. State what visitors should be told about the automated assistant, message purpose and recipients, retention, and where to find more information.
Check your answer against these points:
- Covers automated assistant and message purpose.
- Names the model provider as a recipient.
- States retention and points to the full notice.
- Asks visitors not to submit sensitive details.
Compare with a sample answer
The notice should identify the site and contact route, say the visitor is speaking with an automated assistant, explain what is done with the text and why, name the model provider as a recipient, state how long messages are kept, link to the full privacy notice and ask visitors not to enter sensitive details.
The source notice list names identity, automation, purpose, recipients, retention, a full notice link and a request not to submit sensitive details.
Practice 5
Choose three changes for a chat widget that must work for keyboard and screen-reader users, and one fallback when the service is unavailable. Explain how each change helps the visitor.
Check your answer against these points:
- Names three distinct accessibility changes from the source.
- Includes a non-chat fallback route.
- Connects the changes to visitor access or recovery.
Compare with a sample answer
A real label and visible keyboard focus let people find and use the input without a mouse. A live region means screen-reader users hear each new reply. Not trapping focus, and letting Escape close the widget, means keyboard users can leave the chat. If the provider is down or a limit is reached, show an explanation in words and keep an email, form or human contact route visible so the visitor can still get help.
The accessibility list covers labels, keyboard focus, live-region announcements and focus behaviour. The fallback section calls for an honest message and another route to a person.
Practice 6
Run a paper pre-launch review for a small chatbot. List four checks from the course and describe what you would test when the kill switch is on.
Check your answer against these points:
- Lists four distinct launch checks from the course.
- Tests the kill switch rather than only describing it.
- Checks the fallback message and human route.
Compare with a sample answer
Check that the key is only in the function environment, invalid method and malformed or oversized input are refused, the system prompt and model are set server-side, and a rate limit, daily cap and alert are ready. Test the kill switch and verify that the visitor sees the fallback message and a human route.
The checklist names secret placement, request validation, server-side settings, cost controls and the kill-switch fallback and route.