Skip to content

get_agent_response

Get a Layer agent's answer to a message sent with send_agent_message, waiting up to
`wait_seconds` for the turn to finish.

While the status is queued or working, call again: a question or a plan is back in seconds, a
build in 15 to 45 minutes. Tell the user what the agent is doing from `progress` and `reply`.
Answer a question in `reply` yourself when the user's request settles it; otherwise ask the
user. A priced plan in `pending_plan` is the user's decision: never approve it for them.

Parameters

ParameterTypeDefaultDescription
session_idrequiredstring (uuid)—The session the turn belongs to.
turn_idstring1–∞ chars—The turn_id send_agent_message returned. Omit for the session's running or latest turn.
wait_secondsinteger0–2525Seconds to wait for the agent to finish before returning its current state. 0 returns at once.