Skip to main content

Bot script for a prompter

tip
A script for a prompter bot is a set of states where each state handles a single question and suggests multiple answer options to it.

Here is an example of a prompter bot that provides the agent with answer suggestions to common questions from university enrollees:

theme: /

state: Start
q!: $regex</start>
random:
a: Hello! What is your question?
a: Hello! How can I help you?

state: Hello
intent!: /hi
random:
a: Hello! What is your question?
a: Hello! How can I help you?

state: WhichDocuments
intent!: /whichDocuments
random:
a: You can find the details about the required documents at example.com
a: You can find the list of the required documents at example.com

state: GetCertificate
intent!: /getCertificate
random:
a: You can learn how to get your certificate here: example.com
a: Please contact your university management to get your academic certificate.
a: You can get the certificate via the electronic terminal in the 1st academic building.

state: Dorm
intent!: /Dorm
random:
a: Please contact your university management for information on vacant rooms in the dormitory.
a: You can find information on vacant rooms in the dormitory at example.com.

state: Bye
intent!: /bye
random:
a: See you. We are here to help!
a: Good bye. Thank you for your request!
a: All the best! Contact us if you have any questions.

The bot contains the following states:

  • Start — start of the script.
  • Hello — the bot switches to this state if the applicant sends a welcome phrase to the chat.
  • WhichDocuments — the state that contains possible answers to the client’s request for information on the documents required to join the institute.
  • GetCertificate — the bot may switch to this state when a client wants to know how to get an academic certificate.
  • Dorm — the bot switches to this state when a client wants to know about vacant rooms in the dormitory.
  • Bye — this state is triggered by any good-bye phrase from the client.

States are switched via intent! global intents. Here is an example or creating a /WhichDocuments intent.

Go to the CAILA > Intents tab in the side menu. Create the /whichDocuments intent and add the following phrases to the Training phrases field:

what documents do I need to enter
what do I need to enter
what documents do I need
documents to enter

Supplement the training phrases with your own options. The more phrase options, the highly the probability that the bot responds properly to a message from a user.

Now, if the client asks a question about the documents required to join, the /WhichDocuments intent will be triggered. The agent will be provided with a few answers specified in the random tag.