Course menuAIP-C01

Exams / AIP-C01 / Formatting and enriching input for model requests (Converse API, Comprehend, normalization) / Question 1

AIP-C01 practice question: Formatting and enriching input for model requests (Converse API, Comprehend, normalization)

Foundation Model Integration, Data Management, and Compliance 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

An HR software company adds a policy assistant to its platform. The assistant must follow fixed behavior rules, such as never giving legal advice, and those rules must not be changed by text that users type.

The company supports two model families from different providers, and it wants one request format for both so that it can switch models without rewriting the code. Earlier prototypes mixed the rules, the earlier chat turns and the new question into one long user message, and users could sometimes override the rules.

The chat history must still reach the model in the order the conversation happened.

Which request structure meets these requirements?

Choose one answer.

  1. A. Join the rules, the earlier turns and the new question into one user message in each request, so that the model receives all of the context in a single turn.
  2. B. Put the rules in the system field of a Converse request and the history and new question as alternating user and assistant messages, for both model families.
  3. C. Insert the rules as an assistant message at the start of every request, so the model treats them as commitments it made earlier and keeps following them throughout the chat.
  4. D. Use InvokeModel for each family with its own model-specific body, placing the rules in the system field each model expects, so that every model receives its native request format.
Show the answer and explanation

Answer: B

  • A. Wrong: Mixing rules and user text in one message lets the user's text compete with the rules, which is the override problem. It also loses the turn structure that the model uses to follow the conversation.
  • B. Right: The Converse API keeps the system instructions separate from user turns and accepts one request shape across supported models, so switching models needs no code rewrite. Alternating messages preserve the conversation order, which meets every requirement. Learn more: Carry out a conversation with the Converse API (opens in a new tab)
  • C. Wrong: Rules placed in an assistant turn are not a reliable system instruction, and users can still write text that overrides them. This structure misuses the message roles and does not give the protection the company needs.
  • D. Wrong: This keeps each model's native format, but the company would maintain a separate body for each family. That breaks the single request format requirement, so switching models would still need code changes. Learn more: Inference request parameters and response fields for foundation models (opens in a new tab)

Explanation

The Converse API separates the system instructions from user turns and uses one request shape across models, which makes model switching a configuration change. Alternating user and assistant messages keep the history in order. Mixing everything into a user message, misusing the assistant role and maintaining per-family bodies each fail a stated requirement.

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 Formatting and enriching input for model requests (Converse API, Comprehend, normalization)? The 5 full-length practice sets have 5 more Formatting and enriching input for model requests (Converse API, Comprehend, normalization) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets