
Let's make a quick and dirty Python server using Flask. Now we are ready to create our web service, but before that, let's make sure that our Action welcomes us in a proper manner.Whenever the intent is triggered, it will send a POST request to your website with the body of the request containing a JSON object with the current location of the user.Enable the "Webhook" option and insert the URL that is being "listened" by your webserver.Click "Save" and then go to the "Fulfillment" option on the left-hand side.Scroll down to "Fulfillment" click on "ENABLE FULFILLMENT" and then turn on the "Enable webhook call for this intent".Do not add any responses, just enable "Set this intent as end of conversation".Go to "Responses" and click on "ADD RESPONSE".Before that, we also want to set our intent to conclude the action after being fulfilled. Your hook will be called when this specific intent is triggered and should produce the fulfillment of this action. Now it is time to hook your web service to the Google Assistant Action. For extra effect you can also click on "Allow automated expansion" to give Google Assistant further liberties to try and match more synonyms with your reference values.
#Google voice actions listen to code

Keep in mind we are not going to use the SDK since we are running this completely within Google Assistant and not our own device. In this Instructable we are going over the steps necessary in order to launch your own Google Assistant Action which will communicate with your server and talk back to you, listing upcoming departures. If you want to read more about the project, I would be delighted if you take a look at the related article on my blog: Custom actions for Google Assistant. I reused one of my older projects, VasttraPi and interfaced it with Google Assistant. Seeing the potential of Google Assistant as it was presented in Google I/O 18 as well as Volvo Cars in their infotainment system, I could not resist trying it out.
