Rasa

Rasa

The rasa verb connects a call to a Rasa assistant. It was added in v0.6.6.

{
  "verb": "rasa",
  "url": "http://my-assitant.acme.com/webhooks/rest/webhook?token=foobarbazzle",
  "prompt": "Hello there! What can I do for you today?",
  "eventHook": "/rasa/event",
  "actionHook": "/rasa/action"
}

You can use the following attributes with the rasa verb:

Option Description Required
url URL to connect to the Rasa assistant using the RestInput channel. Yes
prompt An initial greeting to play to the user. No
eventHook A webhook that is called when the Rasa assistant returns either a user message or a bot message. No
actionHook A webhook that is called when the rasa verb completes. No
tts If provided, audio prompts will be played using these text-to-speech choices rather than the application defaults. No
tts.vendor Speech vendor to use: Google, aws (alias: polly), or default (for application default). No
tts.language Language code to use. Yes
tts.gender (Google only) MALE, FEMALE, or NEUTRAL. No
recognizer If provided, the speech recognition settings to use (defaults to application settings). No
tts.voice Voice to use. Note that the voice list differs whether you are using AWS or Google. Defaults to application setting, if provided. No
recognizer.hints Array of words or phrases to assist speech detection. No
recognizer.language Language code to use for speech detection. Defaults to the application level setting, or 'en-US' if not set. No
recognizer.profanityFilter If true, filter profanity from speech transcription. Default: no. No
recognizer.vendor Speech vendor to use (currently only Google supported). No

The rasa verb performs speech recognition on the caller’s audio stream and sends it as text input to the Rasa assistant using the Rasa RestInput channel. Text returned from the assistant is played to the caller using text-to-speech. As the conversation proceeds, webhook events can be sent to notify of all the messages being exchanged between the user and the bot, allowing your application to intervene at any point (e.g., to transfer the call to an agent).

ActionHook Properties

The actionHook webhook will contain the following additional parameters:

  • rasaResult: The completion reason:
    • caller hungup – The caller hung up.
    • redirect – A new application was returned from an event webhook and is now being executed.
    • timeout – The user did not respond to a prompt.
    • webhookError – An error was received attempting to call an event webhook.

EventHook Properties

The eventHook webhook will contain two parameters: event and message. The event parameter will be either userMessage or botMessage depending on whether the message comes from the user or the Rasa assistant, and message will contain the message itself. Your event webhook may return a new application in a JSON payload, in which case the call will be redirected to that application.

Ready To Get Started?