code: def hello_rivescript():
      
  
      from_number = request.values.get("From", "unknown")
      message     = request.values.get("Body")
      reply       = "(Internal error)"
  
      # Get a reply from RiveScript.
      if message:
          reply = bot.reply(from_number, message)
  
      # Send the response.
      resp = twilio.twiml.Response()
      resp.message(reply)
      return str(resp)
docs: Receive an inbound SMS and send a reply from RiveScript.