Indecision is something our team knows well, especially when it comes to food. Making plans for dinner consists of a lot of repetition of phrases like "I don't know", "I don't care", and "Whatever you want". Now the decision is out of our hands!

What it does

The Google Food Assistant responds to your request for a meal by calling on the Google Maps API, searching your surrounding area for places that fit your criteria (or just any place nearby), and spitting out a restaurant, with its rating, for you and (possibly) your friends to go to. Are you in the mood for Italian, and nobody else seems to mind? Ask for an Italian restaurant, and the Google Food Assistant will toss out a nearby Italian restaurant for you to go test. Looking for something a little fancier? Is it date night? Ask Google for a fine-dining location, and discover a new spot for you and that special someone. Are you a poor college student who wants to go out but can't afford the previous options? No worries! Just ask Google where some cheap eats are and enjoy your meal for the lowest prices!

How we built it

Using Dialogflow, we compiled a set of possible user requests and the respective responses. Then, we drafted up a node.js script to perform all the necessary API calls and parsing of JSON objects to create responses to each type of user question. To ease the quantity of javascript code, we designed several entities in Dialogflow that would ensure function arguments were valid and accurate to what the user was asking for.

Challenges we ran into

Currently, the location is hardcoded into the system as Tampa, as requesting location permissions from the Google Home required some authorization we couldn't finish in the time frame given. Also, all of the Google Maps APIs are not RESTful, so we had to use some tricky workarounds with node.js modules to make it possible for us to make all the necessary API calls.

Accomplishments that we're proud of

Finding a method of making the API calls from node.js despite Dialogflow's best efforts to work against us was the biggest accomplishment of this challenge.

What we learned

The level of javascript knowledge necessary to complete this project was far above our heads when we started. We learned how to compound asynchronous functions, proper utilization of callbacks and promises, and handling variable scope in javascript. Furthermore, we were able to obtain some experience using a different type of API than what we are used to, which allowed us to add one more tool to our toolbelt.

What's next for Food Assistant

Dynamically setting location by using authorization protocols will allow for the application to be put into distribution. Increasing the variety of specifications for the restaurant being looked for will allow for a higher quality user experience. This includes adding a system for compound requests (i.e "Italian" and "cheap" restaurants).

Share this project: