Skip to content

Instantly share code, notes, and snippets.

@amn41
Created August 21, 2017 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amn41/adc35932a723306989bf2e0470a8233e to your computer and use it in GitHub Desktop.
Save amn41/adc35932a723306989bf2e0470a8233e to your computer and use it in GitHub Desktop.
from rasa_dm.actions import Action
import requests
class ActionHTTPRequest(Action):
def name(self):
return "make_request"
def run(self, dispatcher, tracker, domain):
url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22nome%2C%20ak%22)&format=json'
result = requests.get(url).json()
dispatcher.utter_template("result : {}".format(result))
return []
a = ActionHTTPRequest()
a.run( None, None, None)
@sanjavia
Copy link

Yup I completely understand that, once I have the REST or Web service created I can make a call like this. But again my question exists how can I set up RASA Core as HTTP api or as web service which I can then consume using above action method. I hope you are able to get my question what I am trying to convey you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment