Further Customization with Chatbot
Learn about using Chatbot to create more customization chatbots.
We'll cover the following
Chatbot
overview
Similar to how we have used Blocks
to create more customizable pages compared to Interface
, we can also use Chatbot
instead of ChatInterface
. Chatbot
is more low-level than ChatInterface
, and allows more control over the chatbot UI. If we want to customize our pages more, such as having specific buttons, markdowns or other such components, we can use Chatbot
instead.
Chatbot
functions similarly to the ChatInterface
. However, rather than requiring a function, this must instead be triggered via Event Listeners. If the Chatbot
is passed as an input component, it will be preprocessed as a list of lists, with each inner list being a user-agent message pair. If it is passed in as an output, it will likewise return a list of lists.
Let’s see this in action through an example.
Building a chatbot: Adding like and dislike
We are going to extend our chatbot by adding the functionality to like and dislike the response by the agent. The agent will then also respond to our action. Let’s have a look at what the code looks like!
Get hands-on with 1300+ tech skills courses.