Steps are the core building blocks that dictate how conversations progress in a bot interaction. Each Step represents a distinct point in the conversation where the bot performs an action, gathers information, or decides where to go next. Think of Steps as checkpoints in a conversation that guide the flow, manage user inputs, and determine outcomes.

Blocks is currently in beta. We’re excited to have you try this new feature and welcome your feedback as we continue to refine and improve the experience.

Features

  • Output: The data or response expected from the step, as outlined in the block’s outputSchema.
  • Input: The data necessary for the step to execute, defined in the block’s inputSchema.
  • Destinations: This can be determined by a simple linear progression or based on specific criteria, like conditions or rules set within the Step. This enables dynamic decision-making, allowing the assistant to choose the next Step depending on what happens during the conversation (e.g., user input, a specific value, or a condition being met).

Example

  {
  "type": "handoff",
  "name": "get_user_order",
  "input": {
    "name": "John Doe",
    "email": "[email protected]"
  },
  "destinations": [
    {
      "type": "step",
      "stepName": "confirm_order",
      "conditions": [
        {
          "type": "model-based",
          "instruction": "If the user has provided an order"
        }
      ]
    }
  ],
  "block": {
    "name": "ask_for_order",
    "type": "conversation",
    "inputSchema": {
      "type": "object",
      "required": ["name", "email"],
      "properties": {
        "name": { "type": "string", "description": "The customer's name" },
        "email": { "type": "string", "description": "The customer's email" }
      }
    },
    "instruction": "Greet the customer and ask for their name and email. Then ask them what they'd like to order.",
    "outputSchema": {
      "type": "object",
      "required": ["orders", "name"],
      "properties": {
        "orders": {
          "type": "string",
          "description": "The customer's order, e.g., 'burger with fries'"
        },
        "name": { 
          "type": "string",
          "description": "The customer's name"
        }
      }
    }
  }
}