input: Write a function that creates a Python Flask app to listen for POST requests on the '/webhook' route. The function should extract necessary parameters from the request and call the 'makeWebhookResult' function to generate a JSON response containing a 'speech' field with the text to be spoken by the voice assistant. The app should run on port 5000 in debug mode.
  
  
  def create_flask_app():
      import requests
      import urllib2
      import json
      import os
      from flask import Flask, request, make_response
      from bs4 import BeautifulSoup 
  
      app = Flask(__name__)
  
      @app.route('/webhook', methods=['POST'])
      def webhook():
          req = request.get_json(silent=True, force=True)
          res = makeWebhookResult(req)
          res = json.dumps(res, indent=4)
          response = make_response(res)
          response.headers['Content-Type'] = 'application/json'
          return response
  
      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')
                  contenido = soup.find_all("div",class_="textRightColumn")
                  if (len(contenido)==0):
                      speech = "No encontrado"
                  else:
                      speech = contenido[0].get_text()
              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,
              "source": "apiai-onlinestore-shipping"
          }
          
      if __name__ == '__main__':
          port = int(os.getenv('PORT', 5000))
          app.run(debug=True, port=port, host='0.0.0.0')
          
  assert create_flask_app().route == '/webhook'
  assert create_flask_app().run.__name__ == 'run'
  assert create_flask_app().run.__defaults__ == (None, 5000, None, True, False)
  assert create_flask_app().makeWebhookResult({'result': {'action': 'productos.sura', 'parameters': {'tipo_cliente': 'cliente-test'}}})['speech'] == "Buscando productos para cliente-test"
  assert create_flask_app().makeWebhookResult({'result': {'action': 'producto.info', 'parameters': {'producto': 'hogar'}}})['speech'] != "No encontrado"
  assert create_flask_app().makeWebhookResult({'result': {'action': 'planes.salud', 'parameters': {}}})['speech'] != ""
  assert create_flask_app().makeWebhookResult({'result': {'action': 'info.especialistas', 'parameters': {'plan-salud': 'plan-test', 'ciudad': 'ciudad-test', 'especialidad': 'especialidad-test'}}})['speech'] != ""
  assert create_flask_app().makeWebhookResult({'result': {'action': 'coberturas.producto', 'parameters': {'productos': 'producto-test'}}})['speech'] == "Buscando coberturas del producto: producto-test"
  
output: def create_flask_app():
      import requests
      import urllib.request
      import json
      import os
      from flask import Flask, request, make_response
      from bs4 import BeautifulSoup 
  
      app = Flask(__name__)
  
      @app.route('/webhook', methods=['POST'])
      def webhook():
          req = request.get_json(silent=True, force=True)
          res = makeWebhookResult(req)
          res = json.dumps(res, indent=4)
          response = make_response(res)
          response.headers['Content-Type'] = 'application/json'
          return response
  
      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 = urllib.request.urlopen(url).read()
                  soup = BeautifulSoup(r, 'html.parser')
                  contenido = soup.find_all("div",class_="textRightColumn")
                  if (len(contenido)==0):
                      speech = "No encontrado"
                  else:
                      speech = contenido[0].get_text()
              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,
              "source": "apiai-onlinestore-shipping"
          }
          
      if __name__ == '__main__':
          port = int(os.getenv('PORT', 5000))
          app.run(debug=True, port=port, host='0.0.0.0')