# Auto-generated by the Cortex Python SDK

from flask import Flask, Response, request
from cortex import Message
from cortex.utils import json_str, get_logger

log = get_logger(__name__)

{{action_globals}}


def _invoke(params):
{{action_code}}

    return {{func_name}}(params)

app = Flask(__name__)

@app.route("/health")
def health():
    return Response(response='OK!', status=200, mimetype='text/plain')

@app.route("/invoke", methods=['POST'])
def invoke():
    output = _invoke(request.json)
    return json_str(output)