Search code examples
facebook-messengerwit.ai

location extracted from wit.ai is blank in facebook messenger


I'm using Wit.ai to extract the location from a sentence. When I execute the bot in Wit.ai to reflect the location it works perfectly

how is the weather in California?

You asked about the weather in California

But when I connect the Wit.ai API to my node JS app (simple, straight forward app using "RunActions") to connect to facebook messenger I get

how is the weather in California?

You asked about the weather in

There is a blank. Any ideas?


Solution

  • It will work in Console because we emulate a function to manage the context. But you will have to implement a function on your side to carry/update the context. We removed the mandatory "merge" but you can use or even create your own merge function that will look at the entities and eventually update the context when some entities exist

    Look at the fetchWeather example here: https://wit-ai.github.io/witty-fiddle/?id=5a387f6ccb4be4a1f77f2113747a558a