Skip to course content
Free generative AI app course

Generative AI Application Development with Python

Module 09 Activity

Scenario

The provider will rate limit you, time out on you, and go down. Decide now what happens.

What you build

A retry policy that classifies failures, backoff with jitter and a ceiling, a degradation ladder, and distinguishable error messages.

Steps

  1. Classify every failure mode as retryable or not, and say why.
  2. Implement exponential backoff with jitter and a hard retry ceiling.
  3. Handle a timeout as ambiguous: retry with an idempotency key rather than assuming failure.
  4. Build at least three rungs of the degradation ladder, including returning source text without a generated answer.
  5. Write five distinguishable error messages containing no internals.
  6. Give each one a request id the user can quote.

Evidence to hand in

Review checklist