Prompter API
The Prompter API allows you to connect prompters to Tovie Agent or integrate them into third-party applications.
To use prompters in Tovie Agent:
- Add the
$prompter.pushReply
method to the bot script. - Connect the Prompter API channel.
- Copy the webhook address and paste it into the Tovie Agent settings.
Add the $prompter.pushReply method
The $prompter.pushReply
method sends an agent appropriate answers to customers’ questions.
-
Go to the code editor in Tovie Platform.
-
Create intents and add a
match
event to the script or add modules to the knowledge base and connect it to the script so that prompters can use answers from there:state: Match
intentGroup!: /KnowledgeBase
event!: match
script:
$prompter.pushReply();
Connect the Prompter API channel
On the control panel, go to Channels → Inbound → Connect channel. Select Prompter API in the Prompters section.
Fill out the fields:
-
Name — specify the channel name.
-
Branch — specify the project branch you want to deploy into the channel (
master
by default). You can also select a Git tag or enter a specific commit hash. -
Deployment — select Automatic (whenever any change made to the project is saved) or Manual (using the Deploy button in the channel description line).
cautionYou have to deploy a script before starting the bot. At this stage, the system builds the bot, checks the script syntax, and performs tests.
Select Create. Once created, the channel editing window will open and new fields will appear:
- Access token — it is configured automatically when the channel is created.
- Webhook address — it is used to connect prompters in Tovie Agent. Copy it.
Use the webhook to connect the API to Tovie Agent
Go to Tovie Agent → Settings section. In the Prompters tab, you can add a prompter and paste the Prompter API webhook.