Bot Actions

Introduction to Bot Actions

A bot action is a component that enables you to program logical conditions leading to responses and link user actions to build complex conversational flows. Bot actions are usually triggered by intents but can also be activated by a filter.

๐Ÿ“Œ

Note:

There is no technical difference between a "Start bot action" and a standard "Bot action."

Execution of a Bot Action

A bot action is executed according to these rules:

  1. API Calls: Executed in the order of API connections.
  2. Conditions: Evaluated from top to bottom. The first matched condition determines the response shown to the user.

API Connections

Video Tutorial

Watch a step-by-step tutorial on integrating external APIs on your ViaSay Chatbot platform in Video Tutorials section.

When to Use API Connections

Use API connections when interacting with external systems via web APIs or a Knowledge Base hosted by ViaSay.

Adding an API Connection

  1. Click Add an API Connection.

  2. Select an API (note: configure the API first in the Integrate/APIs section).

    Configure your API in Integrate/API section

    Configure your API in Integrate/API section


  3. Configure Inputs and Outputs fields as required.

    Configure Inputs and Outputs fields as needed

    Configure Inputs and Outputs fields as needed


  4. Add multiple connections if needed, but excessive connections may slow execution, especially with slow third-party APIs.

Run in Parallel

API calls are executed sequentially by default. Activate the "Run in Parallel" setting to execute multiple connections simultaneously. Note that execution order cannot be controlled in parallel mode.

Inputs and Outputs

Inputs: Define input fields supported by the API. For required inputs:

  • Use a variable name from the bot context.
  • Submit fixed values as strings.
  • Submit JSON by stringifying it, then unstringifying it using Jinja filters and functions.

Outputs: Assign variable names for the API response to appear in the bot context. Avoid conflicts between output variables.

Default input: "status_code" (stores API status code).

Loops

Activate loops for repetitive API calls:

  • For: Specify the changing input variable.
  • In: Define the list of elements to loop on (use JMESPath).

Loops are limited to 8 calls per API. .

Conditions and Answers

Conditions and Answers

Conditions and Answers


Conditions

IF Statements: Use Jinja to write conditions. Variables, functions, and ViaSay extensions can be utilized. For unconditional execution, use IF True.

Go To: Direct the user to another node in the conversational graph. Options include:

  • Start User Action: Redirect to the start of another use case.
  • Current User Action: Keep the user in the current action (e.g., after a misunderstanding response).

Erase: Define variables to be erased post-execution. Options include:

  • "erase_all": Resets the context.
  • "erase_all_except variable1, variable2": Keeps specified variables.

Events: Trigger events for analytics when a condition is matched.

Schedulers

Add schedulers by clicking the action icon.

Add a Scheduler

Add a Scheduler


Answers

Answers are the responses displayed to users after a bot action is executed. They are triggered by conditions within bot actions.



Next page