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. work, office, Aptiv, code mines (lol just kidding).Set the name to "current-location" and define two reference values along with their synonyms:.Click on the "Entities" option on the left side.Overall, the most suitable one would be however I think it's best and easiest if we create our own entity which we should call If you double click on one or more words of the training phrases, you will get a list of predefined entities.You can read more about each one of them here.In our case, we want to know whether the user is at home or at work, so we can respond back with the departures from the specific station. Now you have specified what should be more or less expected as an input, we need to define which parts of the input are of interest to our business logic so they can be extracted and highlighted to our server. If you are interested in them, I strongly suggest you follow the official tutorial or watch this video. Here you will not find many details or theory about the various Google Assistant functions and concepts. ![]() Setting up a simple REST server, written in Python with Flask, which will provide the responses or "fulfillment". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |