🔍 Setting Up Google Search and Spelling Correction for Your Chatbot

šŸ“š Enable Google Search in OmniChat to find answers and correct misspelled user queries. Register for a search engine, get an API key, and set up spelling correction for improved chatbot responses.

šŸ’” PRO TIP: Click here to hire an expert to guide you in the step by step. Book a call now to learn all the tips and tricks for training your AI, or let us handle it all for you instead.

This guide explains how to integrate Google Search and spelling correction into your chatbot using OmniChat. Learn to set up custom search engines, enable spelling correction, and use entities for more accurate search results.

The Google search features give your chatbot the ability to search for answers on Google and your website and automatically correct misspelled user questions. To start using it, follow the steps below.

  • Register atĀ https://programmablesearchengine.google.com/.
  • Create a search and setup it is as you want. We recommend to add only your website and Wikipedia if you want your chatbot to reply to general questions, leave disabled the optionĀ Search the entire web. Use the settingĀ EntitiesĀ to exclude invalid results.
  • Go toĀ Edit search engine > Setup > BasicĀ and copy theĀ Search engine IDĀ value, paste it in OmniChat.
  • To get the API key visitĀ https://developers.google.com/custom-search/v1/overviewĀ and clickĀ Get a key.

Spelling correction

In the case where Dialogflow is unable to find the appropriate response to the user’s message, this function verifies if there are any spelling errors. If any such errors exist, Dialogflow is prompted again with the correctly spelled version of the message for an accurate response. Although it has a lower priority, this feature can still work together with the OpenAI Dialogflow spelling correction feature.

Entities

TheĀ EntitiesĀ setting analyze the user’s message and recognize and extract entities like cities, events, dates, and more. Use it to exclude invalid results returned by Google search. To enable this setting follow the steps below.

  • Log in toĀ https://console.cloud.google.comĀ with your Google account and select the project of your Dialogflow Agent.
  • EnterĀ Cloud Natural Language APIĀ in the search bar at the top, selectĀ Cloud Natural Language APIĀ and enable the APIĀ .

  • Enable the billing by clickingĀ Left menu > BillingĀ and by enabling a billing account with a valid payment method. Enable billing for the project of your Dialogflow agent.

Information

  • The Google search is performed only if the chatbot does not know the answer to the user’s question and if the length of the user’s message is greater than 4 characters.
  • If the Google search returns a result, the Dialogflow contextĀ google-searchĀ is automatically activated. The context contains the attributeĀ linkĀ which is the website’s link of the Google search result. Use the context to create a new intent that provides the link, if the user sends a message likeĀ tell me moreĀ orĀ I want to know more.

  • Google Search is not required to activate the spelling correction. You can disable Google Search and activate only spelling correction.
  • If Google Search is active, it will have priority over OpenAI.