A school-district bot must detect when Claude truncates IEP summaries. Which API handling practice fits?
Select an answer to reveal the explanation.
Short Explanation
Truncation isn't a silent plot twist—it's a stop_reason you can catch. Cap tokens and check why Claude stopped so half an IEP summary doesn't look like a finished report.
Full Explanation
School-district bots that summarize Individualized Education Program (IEP) materials must treat Claude completion status as an explicit API signal, not as an assumption. Setting max_tokens appropriately and inspecting stop_reason after each Messages API response is the correct handling practice because truncation is a first-class outcome: when generation stops because the token budget was hit, the returned text is incomplete even though it may still look grammatically finished. Detecting that condition lets the district UI warn staff, request a continuation, raise limits for that call, or refuse to present a partial IEP summary as authoritative guidance. Setting stop_sequences and reviewing usage input_tokens to flag incomplete summaries fails by concept: stop_sequences only define where Claude may stop, and input_tokens measures the prompt rather than the output, so neither detects a max_tokens cutoff or tells you whether the current IEP summary was truncated. Monitoring token count consumed and adjusting max_tokens incrementally for the next request fails by concept: that reacts after the fact on a later call and does nothing to flag the current truncated summary as incomplete. Raising temperature and retrying requests when IEP summaries appear shortened fails by concept: temperature changes randomness, not truncation detection, and blindly retrying can repeat or compound the cutoff without ever inspecting stop_reason to confirm whether the current summary is incomplete. Exam caveat: stop_reason values cover more than truncation (for example end_turn versus max_tokens), so handlers must branch on the actual reason rather than treating any non-success as identical, and IEP-related prompts still require privacy, access-control, and human review controls separate from token budgeting. Operational check: in a staging school-district client, force a low max_tokens on a long IEP-summary prompt, assert the client reads stop_reason, surfaces a truncation state in the UI, and never marks the summary complete until a full non-truncated generation is confirmed.