Creating a Custom Chatbot
In this section, we will create a custom chatbot to get stock market quotes using Amazon Lex. The bot will listen to our utterances for a valid intent: GetQuote
. This signals to the bot that, for example, we had to get a stock market quote for a given stock ticker symbol, which will reside in a slot named ticker. The bot will then look up the quote for that ticker symbol from a freely available financial API named IEX, and will return the information to the user via a conversational response:
Note
A stock ticker symbol is the standard way in which stocks that are traded on an exchange, such as the New York Stock Exchange or NASDAQ, are represented. A sequence of alphabetical letters represents the company's stock that is being traded.
We can create a flowchart for this process, as shown in the following diagram. Let's go over it in further detail: