Skip to main content

Prompter API

The Prompter API allows you to connect prompters to Tovie Agent or integrate them into third-party applications.

tip
prompter is a bot that joins conversations between customers and agents. It prompts agents with answers to questions, but it does not communicate with customers directly.

To use prompters in Tovie Agent:

  1. Add the $prompter.pushReply method to the bot script.
  2. Connect the Prompter API channel.
  3. Copy the webhook address and paste it into the Tovie Agent settings.
tip
To enable Prompter API, contact your account manager or send us a message at bd@tovie.ai.

Add the $prompter.pushReply method

The $prompter.pushReply method sends an agent appropriate answers to customers’ questions.

  1. Go to the code editor in Tovie Platform.

  2. 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 ChannelsInboundConnect 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).

    caution
    You 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 AgentSettings section. In the Prompters tab, you can add a prompter and paste the Prompter API webhook.

tip
Learn more about the types of prompters and how to set them up in the Tovie Agent documentation.