How to Integrate Bots with ChatBright Pattern Contact Center integrates with providers like IBM Watson to enable chatbots to be used in your contact center services. In this article, you will learn how to integrate an IBM Watson Assistant (i.e., a conversational bot) with your configured chat service.In [[5.3:Contact-center-administrator-guide/WebChatConfiguration | How to Configure Web Chat]], you learned how to set up a chat scenario, chat service, and chat scenario entry point to work together to display a chat widget on your website. A working chat widget connects a customer on a website to a live agent in your contact center.When a bot is integrated with your chat services, customers can be connected to the bot, which can answer questions, provide assisted self-service, and connect to a live agent if needed. Even if the chat is routed to an agent, the integrated bot still runs in the background, ready to assist the agent by providing suggestions (i.e., suggested responses for the agent to select and use).This article assumes that you have:* Read and understand [[5.3:Contact-center-administrator-guide/WebChatConfiguration | How to Configure Web Chat]]* Access to your company’s IBM Cloud account* Some understanding of how Watson Assistant worksThis procedure consists of the following concepts:* Create a bot in IBM Watson* Add an IBM Watson integration account* Create or choose a chat scenario that incorporates bot interactions* Create or choose a chat service for your bot* Link the chat scenario and service to your integration account* Test the chat# You can also read our basic guidelines in [[5.3:Tutorials-for-admins/HowtoCreateWatsonAssistant | How to Create a Watson Assistant]].Your credentials are necessary for integrating Bright Pattern Contact Center with your Watson Assistant. You will be using these credentials in later steps to add an integration account.# Copy the '''Url''', '''Username''', and '''Password''' for your Watson Assistant to a separate doc, such as a text file.[[File:ChatWat2.PNG|thumb|800px|center|Watson Assistant credentials]]Integration accounts are what allow your contact center to operate with third-party services.Fill in all [[Contact-center-administrator-guide/CallCenterConfiguration/IntegrationAccounts/BotChatSuggestionsEngine#Watson_Assistant_Properties | Watson Assistant properties]] or [[Contact-center-administrator-guide/CallCenterConfiguration/IntegrationAccounts/BotChatSuggestionsEngine#Watson_Assistant_.28Legacy.29_Properties | Watson Assistant (Legacy) properties]].Click '''Apply''' at the bottom of the screen to save your account properties.Note that this step is the same as [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Step_1:_Create_or_Select_a_Chat_Scenario | Web Chat Configuration Step 1]].# Give the scenario a unique name (e.g., "Bot Scenario") and click '''Save'''. Your new scenario will appear in the list of scenarios.To use the Watson Assistant in live web chat interactions, you’ll have to edit the basic Mobile Chat scenario template to allow the bot to interact with the customer. For more information about scenarios, see the [[5.3:Scenario-builder-reference-guide/ScenarioBuilderOverview | Scenario Builder Reference Guide.]]There are many ways to construct such a bot-enabled scenario; the instructions given in this step are provided as just one example of how to use your Watson Assistant in chat.In this scenario-building exercise, you will be configuring the system to use the bot to:* Automatically accept the customer’s chat request* Greet the customer* Provide answers to the customer* Provide suggested replies to the agent* Connect to an agent when it’s determined that the bot is not being helpful[[File:Example-Chat-No-Comment.PNG|thumb|800px|center|Example chat scenario in Scenario Builder]]# Select the imported scenario and click '''EDIT''' to open it.The following scenario blocks (with comments) are included in this example scenario. Be sure to read the comments that explain each scenario block's properties.# '''Exit:''' The Exit block completes the scenario. Without it, the scenario will loop through this configured flow until the customer ends the chat.See [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Step_2:_Create_or_Select_a_Chat_Service | Web Chat Configuration Step 2]].Note that this step is basically the same as [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Step_3:_Create_or_Choose_a_Chat_Scenario_Entry | Web Chat Configuration Step 3]], with the addition of another important property.# If there are no existing chat scenario entries shown, you have to create one.# In the Properties tab, fill in the properties as appropriate (see below for required and optional properties). For definitions, see the ''Contact Center Administrator Guide'', section [[Contact-center-administrator-guide/Messaging|Messaging/Chat]].* '''Name''' - The unique name (any) of the chat scenario entry (e.g., "Redwood Chat")* '''Unique identifier''' - A long string of characters that identifies the chat entry. It is recommended that you change it to something short and unique (e.g., "1234").* '''Scenario''' - Choose the Chat Scenario you selected or created earlier in this procedure (e.g., "Super Chat"). This is where the parts come together to make chat possible.* '''Service''' - Choose the Chat Service you selected or created earlier in this procedure (e.g., "Pacific Chat"). This is where the parts come together to make chat possible.* '''Bot / Chat suggestions engine''' - The engine that will provide suggested replies to the agent during chat. Note that in order to use a bot/chat suggestions engine, you must have an integration account configured for your contact center.The [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Other_Properties | other remaining properties]] are optional at this time. You can come back to them later.See [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Step_4:_Edit_Chat_Widget_Style | Web Chat Configuration Step 4]]In order for this chat scenario entry to work, you must add a contact tab for the chat widget. See [[5.3:Tutorials-for-admins/HowtoAddContactTab | How to Add a Contact Tab]].See [[5.3:Contact-center-administrator-guide/WebChatConfiguration#Step_6:_Get_the_HTML | Web Chat Configuration Step 6]]You have now successfully set up your contact center service, scenario, and chat widget to work in an integrated manner with your Watson Assistant. You should test it to make sure that the:* Customer's name entered on the pre-chat form comes through during the chat* Bot is able to automate the conversation with the customer* Customer is connected to an agent if the bot couldn't help within two tries* Agent is able to see the bot's suggestions during the active chatThe following screenshot shows a service chat (on the Agent Desktop side) where the bot provides two responses to the customer and then connects to an agent. You can see the bot's suggestion below the agent's text input field.[[File:BPChat-Ex-1.PNG|thumb|650px|center|Example chat as seen on Agent Desktop]]And the following is how the chat looks to the customer:[[File:BPChat-Ex2.PNG|thumb|350px|center|Example chat as seen by customer on webpage]]