A transit rider app must show disruption explanations as tokens arrive instead of waiting for the full foundation-model completion. Which FM API integration capability should the team use?
Select an answer to reveal the explanation.
Short Explanation
Riders staring at a frozen “thinking…” spinner will bounce—streaming tokens is like a live PA announcement that starts talking immediately instead of waiting for the full script.
Full Explanation
Streaming foundation-model APIs deliver tokens incrementally so a transit rider app can render disruption explanations in real time instead of waiting for the full completion. That FM API integration capability improves perceived latency: riders see the answer start immediately, similar to a live PA announcement rather than a frozen “thinking” spinner. For disruption UX during incidents, first-token latency and progressive render matter as much as total generation time. Buffering the entire model response server-side and releasing it only after a fixed five-minute delay fails the real-time requirement and invents artificial wait. Polling a nightly batch table for static disruption blurbs and disabling live generation fails freshness when incidents evolve throughout the day. Returning HTTP 202 with an empty body and never delivering the generated text fails the product requirement—accepted but undelivered content is not an explanation. Exam caveat: streaming still needs Guardrails and client abort handling; partial tokens may need smoothing so mid-sentence safety cuts do not confuse riders. Back-end timeouts and gateway idle settings must allow long-lived streams. Pair streaming with concise prompts so mobile users on poor networks still finish quickly. Operational check: Enable Bedrock or equivalent streaming on the disruption path; measure time-to-first-token from the rider app; confirm UI appends chunks safely; test abort when the rider navigates away; and validate that safety filters still apply to streamed output.