Prerequisites: You have updated the fulfillment URL of your API.AI agent with the new httpsTrigger URL of the webhook. You have updated the AskForWeather intent to use a required parameter of type @sys.geo-city
Now we are ready to test our weather webhook end to end.
In your test console, type weather.
You don’t get a response. You just get a prompt asking you for the city.
This is expected behavior. When we added a required parameter in the previous step, we were using something called “slot-filling”. The basic idea behind slot filling is: we are trying to collect a list of values from the user before we can get them the answer. In this case, we obviously need the city name before we can provide an answer. So we make the city name a required parameter.
Now type in a city name. I tried London.
And as soon as you input the city name, you get your response with the complete weather details summary for today.
That brings us to the end of the guide and I hope you found it useful. If you have been able to follow along till this step, you now have a working NodeJS based webhook deployed on Google Cloud.
Now you can try to do the following:
- use multiple intents and learn how to handle them using the action parameter
- call a database and get some values
- try using other APIs (e.g. build the Chuck Norris bot using NodeJS)