Back to Parent

Technical Explorations

During the bot development, I tried adding a feature in my chatbot that when the users ask "how to make {drink name}", it will show them the instruction/recipe.

I used this code snippet to extract the drink name from the user input of "how to make {drink name}":

pop1.PNG

I also added the code to look up the cocktail API and return the instruction based on the drink name:

pop2.PNG

After my experiment, I don't think this is a good fit for my project yet because the way that the instruction is organized in the Json data is very complicated. Some of the drinks have the ingredient names and measurements outside of the instruction key while the others of them have the ingredients name in the instruction, which means I may need to make a logic function in my code in order to return the right values.

Also, some of the drinks share the same words in their names, such as Margarita, Blue Margarita and Tommy's Margarita. But they are all stored in the same url in the API, which makes it more difficult to pull the right data. At the same time, it's possible that the users may simply type "Margarita" but they actually mean "Blue Margarita".

A better way to do it would be to save whatever drinks it gives the users in the database and when the users ask how to make this it will automatically search the drink by ID and return the instruction, which would make more sense from the user experience standpoint. But due to the time limit, this feature needs to be held up.  


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0