input: Write a function to create a Python Flask app that listens for POST requests on the '/webhook' route. The app should extract the necessary parameters from the request and call the 'makeWebhookResult' function to generate a response. The response should be a JSON object containing a 'speech' field with the text to be spoken by the voice assistant. The app should be started on port 5000 and run in debug mode.
  def webhook():
  	req = request.get_json(silent=True, force=True)
  	res = makeWebhookResult(req)
     	res = json.dumps(res, indent=4)
     	print(res)
     	r = make_response(res)
     	r.headers['Content-Type'] = 'application/json'
     	return r
  
  def makeWebhookResult(req):
  	result = req.get("result")
  	parameters = result.get("parameters")
  	
  	if req.get("result").get("action") == "productos.sura":
          	cliente = parameters.get("tipo_cliente")
         		speech = "Buscando productos para " + cliente
  		
  	elif req.get("result").get("action") == "producto.info":
          	producto = parameters.get("producto")
  		if (producto=="hogar"):
  			url = "https://www.sura.com/soluciones-personas/seguro-hogar.aspx"
  			r = urllib2.urlopen(url).read()
  			soup = BeautifulSoup(r, 'html.parser')
  			print soup
  			contenido = soup.find_all("div",class_="textRightColumn")
  			if (len(contenido)==0):
  				speech = "No encontrado"
  			else:
  				speech = contenido[0]
  			
  		else:
         			speech = "Buscando informacion del producto " + producto
          
      	elif req.get("result").get("action") == "planes.salud":
          	url = "https://api.segurossura.com.co/public/v1/directory/products"
          	myResponse = requests.get(url)
  
          	if(myResponse.ok):
  			jData = json.loads(myResponse.text)
  			
  		speech = "Seguros Sura Colombia ofrece los siguientes planes de salud: \n"
  		
          	for plan in jData:
  	       		speech = speech + "\n" + plan["nombreField"].title()
  			
  	elif req.get("result").get("action") == "info.especialistas":
  		producto = parameters.get("plan-salud")
  		ciudad = parameters.get("ciudad")
  		especialidad = parameters.get("especialidad")
  		
  		url = "https://api.segurossura.com.co/public/v1/directory/search/" + producto + "/" + ciudad + "?speciality=" + especialidad + "&firstname=&secondname=&firstlastname=&secondlastname="
  		myResponse = requests.get(url)
  
  		if(myResponse.ok):
  			jData = json.loads(myResponse.text)
  		
  		speech = "Los profesionales que coinciden con tu busqueda son: \n"
  
  		for medico in jData:
  	       		speech = speech + "\n" + medico["nombreField"] + "\n Direccion: " + medico["direccionField"].title() + "\n Telefono: " + medico["telefonoField"] + "\n"
  			
  	elif req.get("result").get("action") == "coberturas.producto":
  		producto = parameters.get("productos")
  		speech = "Buscando coberturas del producto: " + producto
  	else:
          	speech =" "
  
  	return {
          "speech": speech,
          "displayText": speech,
          #"data": {},
          # "contextOut": [],
          "source": "apiai-onlinestore-shipping"
      	}
  
  assert webhook()=={
      "speech": "Buscando productos para Cliente",
      "displayText": "Buscando productos para Cliente",
      "source": "apiai-onlinestore-shipping"
  }
  assert webhook()=={
      "speech": "Buscando informacion del producto hogar",
      "displayText": "Buscando informacion del producto hogar",
      "source": "apiai-onlinestore-shipping"
  }
  assert webhook()=={
      "speech": "Seguros Sura Colombia ofrece los siguientes planes de salud: \nPlan A",
      "displayText": "Seguros Sura Colombia ofrece los siguientes planes de salud: \nPlan A",
      "source": "apiai-onlinestore-shipping"
  }
  assert webhook()=={
      "speech": "Los profesionales que coinciden con tu busqueda son: \nDr. Jose Perez \n Direccion: Calle 123 \n Telefono: 123-456-7890",
      "displayText": "Los profesionales que coinciden con tu busqueda son: \nDr. Jose Perez \n Direccion: Calle 123 \n Telefono: 123-456-7890",
      "source": "apiai-onlinestore-shipping"
  }
  assert webhook()=={
      "speech": "Buscando coberturas del producto: hogar",
      "displayText": "Buscando coberturas del producto: hogar",
      "source": "apiai-onlinestore-shipping"
  }
output: 
  def webhook():
      req = request.get_json(silent=True, force=True)
      res = makeWebhookResult(req)
      res = json.dumps(res, indent=4)
      r = make_response(res)
      r.headers['Content-Type'] = 'application/json'
      return r
  