Sending specific words to webhook

112 Views Asked by At

I'm trying to make an agent that can give me details about movies.

For example, the user says "Tell me about (movie-name)", which sends a post request to my API with the (movie-name) which then returns the response.

However, I don't understand how to grab the movie name from the user's speech without creating a movieName entity with a list of all the movies out there. I just want to grab the next word the user says after "tell me about" and store it as a parameter. How do I go about achieving that?

1

There are 1 best solutions below

1
On BEST ANSWER

Yes, you must create a movieName entity, but you do not need to create a list of all movies. Maybe you are experienced with Alexa which requires a list of suggested values, but in api.ai you don't need to do that.

I find that api.ai is not very good at figuring out which words are part of a free-form entity like movieName, but hopefully adding enough user expressions will help it with that.

edit: the entity I was thinking of is '@sys.any' but maybe it would be better to use a list of movie names with the 'automated expansion' feature. I haven't tried that, but it sounds like the way that Alexa's custom slots work, which is actually a lot more flexible (just using the list as a guideline) then people seem to think.