Courseiva
hardMultiple Select

AIF-C01 Practice Question: A developer is using the Amazon Bedrock…

A developer is using the Amazon Bedrock InvokeModel API with streaming enabled. They want to process partial results as they arrive. Which THREE steps are necessary to implement streaming correctly? (Select THREE.)

⚠ Common exam trap

The AWS AI Practitioner exam often tests the distinction between synchronous (waiting for full response) and asynchronous streaming (processing chunks as they arrive), and the trap here is that candidates may think raw HTTP callbacks or waiting for the complete response are valid streaming implementations.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Use the InvokeModelWithResponseStream API operation to request a streaming response.

The correct options are B, D, and E. Option B is required because InvokeModelWithResponseStream is the specific Bedrock API operation that returns a stream of response chunks (via the responseStream event stream) rather than a single blocking response, which is exactly what the developer needs to process partial results as they arrive. Option D is required because the streaming response is delivered as an event stream of typed events such as chunk and modelStreamErrorException, so the client must iterate over the stream and decode each chunk's bytes (for example, base64-decoded JSON delta text) to consume partial output incrementally. Option E is required because streaming responses can terminate with in-stream error events and the connection can drop mid-stream, so the implementation must handle these exceptions and read the stream to completion to avoid truncated output. Options A and C are not part of the necessary streaming implementation: they describe non-streaming or unrelated behaviors and are not marked correct.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Call the standard InvokeModel API and wait for the entire JSON response before processing partial results.

    Why it's wrong here

    Not a separate step.

  • ✓

    Use the InvokeModelWithResponseStream API operation to request a streaming response.

    Why this is correct

    Each chunk contains a piece of the output.

  • ✗

    Enable raw HTTP/2 callbacks on the Bedrock client to automatically invoke a callback for each partial result.

    Why it's wrong here

    Not necessary for streaming.

  • ✓

    Process the response stream by iterating over event-stream records and decoding each chunk event's payload as it arrives.

    Why this is correct

    Required to get streaming behavior.

  • ✓

    Handle in-stream error events (for example, modelStreamErrorException) and consume the stream until completion to avoid truncated output.

    Why this is correct

    Chunks are received as events.

About these practice questions

This AIF-C01 question is part of Courseiva's 862-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AIF-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AIF-C01 exam.