Course menuAIP-C01

Exams / AIP-C01 / Troubleshooting context limits and API errors / Question 1

AIP-C01 practice question: Troubleshooting context limits and API errors

Testing, Validation, and Troubleshooting A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A law firm's document assistant helps attorneys review long case files. Each turn, the application sends the full conversation history and every retrieved passage to a model on Amazon Bedrock. Sessions have grown long, and some turns now fail with a ValidationException that says the input is too long for the model.

Attorneys often run sessions of 50 turns or more, and the team needs those sessions to keep working. The answers to recent questions must not change, and the fix should not raise the cost per turn by much.

Which fix meets these requirements?

Choose one answer.

  1. A. Count input tokens before each call and, when over budget, summarize the oldest turns and drop low-ranked passages, keeping recent turns verbatim.
  2. B. Increase the maximum output tokens for each call so that the model has more room to hold the conversation and the retrieved passages.
  3. C. Catch the ValidationException and retry the call with exponential backoff, since the limit is usually reached only briefly during peak hours.
  4. D. Ask Amazon Bedrock for a higher tokens-per-minute quota for the model, so the account can send longer inputs without errors at busy times.
Show the answer and explanation

Answer: A

  • A. Right: Checking the size before each call prevents the ValidationException, and summaries keep older context at a fraction of the tokens. Recent turns stay verbatim, so the answers to current questions do not change.
  • B. Wrong: The maximum output tokens limit the length of the reply, not the input. A larger limit does not make a too-long input fit.
  • C. Wrong: Backoff is for throttling, which is temporary. An input that is too long fails every time, so retries would only add delay and cost.
  • D. Wrong: Quotas limit throughput across requests, not the number of tokens in a single request. A higher quota would not let one oversized input fit into the model's context window.

Explanation

A ValidationException for a too-long input means the single request exceeds the model's context window, so fixing it means reducing the input. Counting tokens before each call, summarizing older turns and dropping low-ranked passages keeps the input within budget while preserving recent context. Raising output limits, retrying or raising quotas do not change the size of the input.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Troubleshooting context limits and API errors? The 5 full-length practice sets have 5 more Troubleshooting context limits and API errors questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets