In immediately’s digital age, companies are consistently looking for methods to enhance their buyer engagement and expertise. Integrating communication instruments with conversational platforms is one solution to obtain this. Twilio, a cloud communications platform, and Dialogflow CX, a conversational AI platform, have joined forces to supply a seamless integration for companies trying to construct highly effective conversational experiences. With this integration, companies can leverage Twilio’s messaging and voice capabilities, mixed with Dialogflow CX’s pure language understanding and intent recognition, to create refined conversational experiences that may cater to a variety of buyer wants.
Pre-requisites
- To get began with our mission on Dialogflow CX, you’ll must create an account with billing enabled and arrange an agent.
- Moreover, you’ll want a Twilio account with a bought cellular quantity and obtainable credit score for making calls.For testing functions, we suggest utilizing textnow.com, although you’re free to make use of another service or your personal cell phone to create a name.
- Lastly, be sure you have Ngrok put in in your system.
Steps
Step 1. Grant Twilio Permissions to entry your Dialogflow CX agent
- Earlier than you possibly can provoke the one-click integration course of, there’s a one-time handbook step that you have to full. This step includes granting permission to Twilio’s manufacturing service account to run your Dialogflow agent. When you’ve accomplished this step, you’ll have the ability to provoke the one-click integration with ease.
- Log in to your Google Cloud console
- Choose the Google Mission wherein you configured your Dialogflow CX Agent
- Navigate to IAM & Admin > IAM from the left navigation
- Click on +Grant Entry close to the highest of the web page
- Beneath”New Principals”, add virtualagent-ccai-prod@dialogflow-prod-env.iam.gserviceaccount.com as a member with the next roles:
-
- Dialogflow API Reader
- Dialogflow API Consumer
Step 2. Join Twilio to your Dialogflow CX Agent with the one-click integration
Nice job on finishing the prerequisite steps! Now you’re prepared to make use of the one-click integration course of to attach your Twilio Dialogflow CX Connector to the Dialogflow CX agent of your alternative. This must be a seamless course of and will let you shortly begin utilizing the mixing.
- Log in to your Google Dialogflow CX cloud console.
- On the left-hand facet navigation bar, click on on the “Handle” choice.
- From the drop-down menu, choose “Integrations”.
- Search for the “One-click Telephony” part, after which choose “Twilio” from the choices obtainable.
- give your integration a brand new identify. This may be something you want, however make sure that it’s one thing descriptive so you possibly can simply establish it in a while.
- Choose the Setting and Language to your Dialogflow CX agent. That is vital as a result of it should decide how your agent will work together with customers.
- When you’ve entered all the mandatory info, click on on the “Add” button. This can begin the mixing course of and launch the Twilio Console web page, the place you possibly can configure your Twilio account and join it to your Dialogflow CX agent.
Step 3. Configuration steps within the Twilio Console
When you’ve adopted the steps within the Google Cloud Console, you’ll be directed to the Twilio Console to finish the Dialogflow integration. You need to see a web page titled “Dialogflow CX one-click integration”, which incorporates the Dialogflow CX Connector with pre-populated values.
On this web page, you possibly can configure your integration settings, such because the cellphone quantity you wish to use for telephony interactions and different choices. It’s vital to assessment these settings rigorously to make sure that your integration is ready up accurately and dealing as anticipated. When you’ve made any obligatory modifications, it can save you your settings and begin utilizing your Twilio Dialogflow CX Connector instantly.
To arrange your Twilio Dialogflow CX Connector, you’ll must configure the next settings:
- Connector Pleasant Title: It is a distinctive identify that you simply’ll use to establish your Connector in Twilio Studio or utilizing TwiML. Let’s say you identify it “test_demo”.
- Standing Callback URL (non-compulsory): That is the URL the place you need Twilio to ship requests on name standing, intents triggered, sentiment scores, and extra. For this tutorial, you possibly can hyperlink it to Twilio Capabilities.
- Welcome Intent Pleasant Title: That is the identify of the Dialogflow CX agent welcome intent you wish to set off when connecting the caller to an agent. When you don’t have a customized welcome intent, you need to use the system-generated default welcome intent known as WELCOME.
- Bot Voice: This setting signifies the Textual content-To-Speech voice to make use of when synthesizing audio responses from the bot. You may try Google’s documentation for a listing of voices at the moment supported for Dialogflow.
- Sentiment Evaluation: This setting determines whether or not or not Dialogflow will carry out sentiment evaluation on the end-user enter. If it’s set to ON, sentiment scores will probably be relayed within the standing callbacks. Notice that sentiment evaluation availability will depend on the language assist in Dialogflow CX.
When you’ve configured your Connector with all the main points, click on on “Subsequent”. You’ll then see a “Evaluate Data” display prompting you to assessment your Connector configuration. If one thing is inaccurate, you possibly can click on on “Earlier” to replace the Connector settings. If all the things seems good, click on on “Affirm Configuration Particulars”.
After configuring your Twilio Dialogflow CX Connector, you’ll see a modal pop-up asking to your consent to attach your Connector to your Dialogflow CX agent. When you don’t wish to proceed with the setup, you possibly can click on on the X on the prime proper nook of the modal pop-up or shut your browser tab.
If you wish to proceed, click on on “Agree and connect with Google” to complete the mixing setup.
Congratulations! Your Dialogflow CX integration with Twilio is now full. You may confirm that the Connector occasion is accomplished by checking beneath the Dialogflow CX Connectors part within the Twilio Console.
When you’ve accomplished the mixing between Dialogflow CX and Twilio, Twilio mechanically creates a brand new Studio Movement with a Join Digital Agent Widget in it.
To set the move, comply with these steps:
- Open the Twilio Console.
- Click on on “Develop” and choose “Studio” from the dropdown menu.
- Click on on “Flows” and choose the identify of the move that you simply wish to use.
- Set the move as desired, utilizing the Join Digital Agent Widget that was mechanically created for you as a part of the mixing.
Beneath is the screenshot of connecting an agent with Twilio.
To attach an outgoing name, you need to use the “Make Outgoing Name” widget from the Widget library in Twilio Studio. You may then join it with the Relaxation API as proven within the picture beneath:
This can let you make outgoing calls utilizing Twilio and join them along with your Dialogflow CX agent for pure language processing and clever responses.
Relaxation API:
Set up the twilio library in your system. For set up within the Ubuntu system use this command.pip set up twilio
Script:
from twilio.relaxation import Consumer
# Your Account Sid and Auth Token from twilio.com/console
account_sid = <YOUR ACCOUNT SID>
auth_token = <YOUR ACCOUNT AUTH TOKEN>
# Create a Twilio consumer object
consumer = Consumer(account_sid, auth_token)
execution = consumer.studio
.v2
.flows(<FLOW ID>)
.executions
.create(to= <TO NUMBER>, from_= <TWILIO NUMBER>)
print(execution.sid)
Now, the connection of Twilio of Dialogflow is completed utilizing the mixing we setup.
You may check it by creating calls out of your cellular to the quantity bought from twilio. You’ll hear voice from Dialogflow agent.
Be happy to remark your doubts/questions. We’d be glad that can assist you. In case you are in search of Chatbot Improvement or Pure Language Processing companies then do contact us or ship your requirement at letstalk@pragnakalp.com. We’d be completely satisfied to supply our knowledgeable companies.