Course menuAIP-C01

Exams / AIP-C01 / Synchronous, asynchronous and batch model invocation / Question 1

AIP-C01 practice question: Synchronous, asynchronous and batch model invocation

Implementation and Integration 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 tax software company's assistant answers filing questions. Users type a question in a web app, and a Lambda function calls a model on Amazon Bedrock and returns the answer through an Amazon API Gateway REST API. Long answers take 45 to 60 seconds, but the REST API integration stops waiting after 29 seconds, so those users see errors.

The company has three requirements. Users must not see timeout errors on long answers, text should appear as the model writes it, and the team does not want to change the model or the web app's short requests.

Which TWO actions meet these requirements? (Choose two.)

Choose two answers.

  1. A. Stream the answer with ConverseStream from a Lambda function with response streaming, exposed through a Lambda function URL, so text reaches the browser as it is generated.
  2. B. Raise the timeout of the Lambda function to 15 minutes and keep the REST API unchanged, so that the function has time to finish long answers before the response is returned.
  3. C. Send long questions to Amazon Bedrock batch inference, which writes the answers to Amazon S3, and have the web app email the user when the file is ready.
  4. D. Keep the REST API for short requests, such as loading a user's saved filing questions, which complete well within the 29-second integration limit.
  5. E. Purchase Provisioned Throughput for the model, so that each call returns faster and stays under the 29-second integration limit without any change to the API.
Show the answer and explanation

Answers: A, D

  • A. Right: A function URL with response streaming sends text to the browser while the model writes, and it does not pass through the REST API's 29-second integration limit. The model and its settings stay the same. Learn more: Configuring a Lambda function to stream responses (opens in a new tab)
  • B. Wrong: The Lambda timeout does not change how long the REST API waits, so users still see errors after 29 seconds. The change also does nothing to show text as it is generated.
  • C. Wrong: Batch inference is designed for large offline jobs, and the answers arrive hours later, not during the session. Email delivery also does not meet the requirement for text that appears as it is written.
  • D. Right: Short calls that finish in a second or two fit the REST API, so the web app needs no change for them. This keeps the existing integration for every request that does not generate a long answer. Learn more: Choose between REST APIs and HTTP APIs (opens in a new tab)
  • E. Wrong: Provisioned Throughput reserves capacity but does not guarantee that one long answer finishes in under 29 seconds. It also does not show text as it is written, and it adds a fixed hourly cost.

Explanation

Streaming through a Lambda function URL lets long answers reach the browser as they are generated, without passing through the REST API's integration timeout. The REST API stays in place for short requests that finish quickly. Longer timeouts, batch processing and reserved capacity each leave the 29-second limit or the streaming need unmet.

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 Synchronous, asynchronous and batch model invocation? The 5 full-length practice sets have 5 more Synchronous, asynchronous and batch model invocation questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets