The ask APIs prompt the user for input. Depending on the API, the user input can be a string, a file, pick an action or fill a form. Until the user provides an input, both the UI and your code will be blocked.

Ask File example

Available Ask APIs

The AskElementMessage API enables agents to send interactive, consent-gated UI components to users. This feature is particularly useful for:
  • Compliance workflows where explicit user consent is required
  • Data review scenarios where users need to review and modify AI-generated data
  • Form completion with pre-filled values for user confirmation
  • Audit trails for sensitive operations
The flow works as follows:
  1. Agent calls a consent-gated tool (e.g., expense logging API)
  2. Backend sends a CustomElement to the frontend with editable fields and timeout
  3. User modifies or confirms the pre-filled values and submits
  4. Backend receives the updated props and proceeds with the tool call using user-approved data
This pattern blocks further chat interactions until user input is received, preventing ambiguous or unauthorized actions.

Ask Element example