This Twilio Flex plugin uses the Azure Cognitive Question Answering service to suggest answers to customer queries for contact center agents. It also enables agents to add and improve suggestions by allowing them to mark questions and answer pairs in chat interactions.
The repository contains two folders:
suggested-response-functions
: contains the code for Twilio Functions used for fetching and adding suggestions, respectively.suggested-response-plugin
: contains the code for a Twilio Flex plugin. The plugin displays suggested responses for the agents to view and send. It also enables agents to mark messages as either questions or answers to add and improve suggestions based on customer interactions.
-
Create and deploy a Question Answering project on Azure. You can use this quickstart to get started.
-
Deploy Twilio Functions
- Install the Twilio Serverless Toolkit.
- Navigate to the function directory:
cd suggested-responses-functions
- Rename
.env.example
to.env
and update it with the details of your Azure deployment from step 1. - Deploy the functions using the
twilio serverless:deploy
command. - Make note of the newly deployed function URLs.
-
Install the Flex plugin:
Note that the plugin uses Flex UI 2.
- Install the Flex Plugins CLI.
- Navigate to the plugin directory:
cd suggested-response-plugin
- Rename
.env.example
to.env
and then open it and setFLEX_APP_SERVERLESS_URL
to the base URL of your Twilio functions from step 2. - Install the flex plugin using the
twilio flex:plugins:deploy
command.
-
Optional: disable updates
By default, the plugin allows agents to add and update suggestions. This can be disabled if needed by updating the Flex Configuration and adding the below entry under
ui_attributes
:"suggested_responses": { "enableUpdates": false }
That's it! Navigate to your Flex instance and click on a messaging-based task to see the plugin in action.
Thanks for reading this far!
If you have any questions, do not hesitate to reach out at hello@slintab.dev