0

I just started with Wit-ai and I'm trying to make the weather forecast bot in quickstart. In the quickstart, it mentions that the action of the bot (getForecast) should be a function defined in a python file (.py) in my computer. However, I'm not sure how Wit-ai connects with the python files in my computer? Like how does Wit-ai know which file to run when a function is called?

PS: I have downloaded the pywit examples and read through the code, but I still don't see how the Wit-ai platform will find the correct function in the correct file.

1 Answers1

0

You will be writing the actions specifying the function name in wit

client = Wit(access_token=access_token, actions=actions)

actions = { 'send': send, 'merge': merge, 'select-joke': select_joke, }

It checks with this name in stories that is trained. You can check https://github.com/wit-ai/pywit/blob/master/examples/joke.py for python code and it's respective wit story at https://wit.ai/patapizza/example-joke

Vrushab Maitri
  • 330
  • 3
  • 14