Question 1 · choose 1
A contract summarizer that uses the Converse API sometimes returns summaries that stop mid-sentence. The responses have no error, the input is well within the context window, and the stopReason field of the affected responses is max_tokens. What is the most likely cause and fix?
- AA guardrail intervened in the output, so review the guardrail's content filter strengths
- BThe output reached the maxTokens limit, so raise it or ask for a shorter summary
- CThe input exceeded the context window, so split the contract into smaller chunks
- DA stop sequence in the prompt ended generation, so remove all stop sequences
Show the answer and why
AA guardrail intervened in the output, so review the guardrail's content filter strengths
Incorrect
A guardrail intervention reports a different stop reason and replaces the output with the blocked message.
BThe output reached the maxTokens limit, so raise it or ask for a shorter summary
Correct
A max_tokens stop reason means the model hit the output limit set in inferenceConfig, so the limit or the requested length must change.
CThe input exceeded the context window, so split the contract into smaller chunks
Incorrect
The input is within the context window, and an oversized input is rejected with a validation error rather than cut off silently.
DA stop sequence in the prompt ended generation, so remove all stop sequences
Incorrect
A stop sequence ends generation with a stop_sequence reason, not max_tokens.
Check stopReason first when output looks cut off. max_tokens means the output budget ran out; end_turn means the model finished; other values point to stop sequences, tool use or guardrail interventions.
AWS documentation
- Inference using Converse API (opens in a new tab)
- Converse - Amazon Bedrock Runtime API Reference (opens in a new tab)
- Include a guardrail with the Converse API (opens in a new tab)
- Influence response generation with inference parameters (opens in a new tab)
- Troubleshooting Amazon Bedrock API Error Codes (opens in a new tab)