問題文
A developer is writing a custom agent loop against the Messages API. After each response, the loop must decide whether to continue. Which condition correctly indicates that the loop should execute tools and send another request?
選択肢
- The response has a stop_reason of max_tokens, which means the loop should resend the same request unchanged.
- The response has a stop_reason of tool_use, meaning Claude requested one or more tools and is waiting for their results before continuing.
- The response contains any text block, since text always precedes a tool call.
- The response has a stop_reason of end_turn, meaning Claude has more to say but ran out of turn.