from responses.responsemessage import ResponseMessage
from responses.responsedata import ResponseData
from responses.responsetype import ResponseType
from responses.response import Response
from responses.quickreply import Quickreply
class WeatherInfo(Response):
baseUri = "http://api.openweathermap.org/data/2.5/weather"
def getResponse(self, sentence, context, options={}):
cities = sentence.getEntitiesWithLabel("stad")
result = requests.get(self.baseUri, params=parameters)
if result.status_code == 200:
weatherInfo = result.json()
description = weatherInfo["weather"][0]["description"]
message = "Het is momenteel {} in {}.".format(
message = "Ik kan het weer in {} niet ophalen...".format(