Skip to content

🤖 Voicebot built on top of Project Fonos

Notifications You must be signed in to change notification settings

harish-chander/rox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rox AI 🤖

Voicebot built on top of Project Fonos with support for Dialogflow.

publish to docker

This repository contains a dockerized distribution of Rox AI.

Available Versions

You can see all images available to pull from Docker Hub via the Tags page. Docker tag names that begin with a "change type" word such as task, bug, or feature are available for testing and may be removed at any time.

The version is the same of the Asterisk this is image is based on

Installation

You can clone this repository and manually build it.

cd fonoster/rox\:%%VERSION%%
docker build -t fonoster/rox:%%VERSION%% .

Otherwise you can pull this image from docker index.

docker pull fonoster/rox:%%VERSION%%

Usage Example

The following is a basic example of using this image.

docker run -it \
  -p 3000:3000 \
  -e WELCOME_INTENT_TRIGGER="hi!"
  -e ACTIVATION_INTENT="bot.activate" \  
  -e INTENTS_ENGINE="dialogflow" \
  -e ASR_ENGINE="google" \
  -e TTS_ENGINE="google" \
  -e TTS_VOICE="en-US-Wavenet-F" \
  fonoster/rox

Specs for Dialogflow backend

To allow for seamless integration between Dialogflow and Rox, we introduced the concept of Effects. Effects are actions sent from Dialogflow to Rox so you don't have to programm the behavior everytime. All you need to do is send the Effect's payload and Rox will react accordingly.

You can send multiple responses from Dialogflow. The Effects will run in sequence.

Effect ID Description Payload Example

say

The Effect will randomly pick a textual response and play it back to the user
{
  "effect": "say",
  "parameters": {
    "responses": [
      "Goodbye!",
      "Talk later",
      "Bye!",
      "Have a good one!"
    ]
  }
}

hangup

The hangup Effect will close the call
{
  "effect": "hangup"
}

send_data

Use this Effect send arbitrary data to the client. Note that this only works with clients that subscribe for events
{
  "effect": "send_data",
  "parameters": {
    "type": "map",
    "icon": "https://freeicons.net/icons/map.png",
    "link": "https://goo.gl/maps/YTum2VeZSQwNB4ik6"
  }
}

transfer

Forward call to a different endpoint
{
  "effect": "transfer",
  "parameters": {
    "destination": "17853178070",
    "record": true
  }
}

Notes: The parameter type is set to map in the example, but you can send anything that makes send to the client. If the parameter allRequiredParamsPresent is set to true, the fulfillmentText will be take presedence over the custom effects.

Environment Variables

Environment variables are used in the entry point script to render configuration templates. You can specify the values of these variables during docker run, docker-compose up, or in Kubernetes manifests in the env array.

  • INTENTS_ENGINE - Use to select the intents engine. Accepts [dialogflow.es, dialogflow.cx]. Required
  • INTENTS_ENGINE_AGENT - Intents Agent identifier. Required for dialogflow.cx
  • INTENTS_ENGINE_LOCATION - Region where the bot was deployed. Required for dialogflow.cx
  • ASR_ENGINE - Use to select the ASR engine. Accepts [google]. Required
  • TTS_ENGINE - Use to select the TTS engine. Accepts [google]. Required
  • TTS_VOICE - Name of the voice. Check https://cloud.google.com/text-to-speech/docs/voices for a list of Google TTS voices. Required
  • INITIAL_DTMF - Set if you want to send a DTMF at the begining of the call
  • WELCOME_INTENT_TRIGGER - Set if you want to ask the backend for a welcome intent
  • ACTIVATION_INTENT - Set to the desired intent if you want to have an activation command. If this is set, the INTERACTION_TIMEOUT will have not effects
  • INTERACTION_TIMEOUT - Timeout, in seconds, to ask again for user input. Use -1 for no timeout. Defaults to -1
  • EVENTS_ENABLED - If set to true it will send events to ws clients subscribed to events. Defaults to false
  • ACTIVATION_TIMEOUT - Time in seconds for the duration of the AWAKE_ACTIVE state, set for the activation command. After this time the bot will return to AWAKE_PASSIVE and new intents will be ignored. Defaults to 15000
  • LANGUAGE_CODE - Sets the default language for the application. Defaults to en-US

Exposed ports

  • 3000 - Port to start a session request
  • 3001 - Port to subscribe to sendData effects

Volumes

  • /etc/rox/google.json - This must exist if INTENTS_ENGINE=dialogflow, or ASR_ENGINE=google, or TTS_ENGINE=google

TODO

  • Add authentication to secure the events port

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

Copyright (C) 2021 by Fonoster Inc. MIT License (see LICENSE for details).

About

🤖 Voicebot built on top of Project Fonos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published