- Getting consent from humans before performing an action
- Getting additional information in order to perform an action
- Asking for clarification
- If
shouldRetryis set totrue, it means you should retry this API. You do not need to wait before retrying since the API does some waiting itself. This is usuallytruewhen we are waiting for the human to respond to your message. The session state can be “stuck” in this state for a long time depending on when the human responds, so you should keep retrying and not continue your agent workflow. - If
shouldRetryis set tofalse, it means the message the human has responded with themessageavailable in the response body, and you can continue your agent workflow.
- It can also return a
400status code if the session is in a different state (like if you had requested for a human input with a different prompt and are still waiting for that). Therefore, we recommend that you only continue your agent workflow once the API has returned a200status code. - If the API returns a 5xx error, or is down, then you should wait for up to 1 second and try again.