rasa/core/server.py
def ensure_loaded_agent(app):
    """Wraps a request handler ensuring there is a loaded and usable model."""

    def decorator(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            if not app.agent or not app.agent.is_ready():
                raise ErrorResponse(
                    503,
                    "NoAgent",
                    "No agent loaded. To continue processing, a "
                    "model of a trained agent needs to be loaded.",
                    help_url=_docs("/server.html#running-the-http-server"))

            return f(*args, **kwargs)

        return decorated

    return decorator
Wraps a request handler ensuring there is a loaded and usable model.
Wraps a request handler ensuring there is a loaded and usable model.
Wraps a request handler ensuring there is a loaded and usable model .
def ensure_loaded_agent(app):
    def decorator(f):
        @wraps(f)
        def decorated(*args, **kwargs):
            if not app.agent or not app.agent.is_ready():
                raise ErrorResponse(
                    503,
                    "NoAgent",
                    "No agent loaded. To continue processing, a "
                    "model of a trained agent needs to be loaded.",
                    help_url=_docs("/server.html#running-the-http-server"))
            return f(*args, **kwargs)
        return decorated
    return decorator
def ensure_loaded_agent ( app ) : def decorator ( f ) : @ wraps ( f ) def decorated ( * args , ** kwargs ) : if not app . agent or not app . agent . is_ready ( ) : raise ErrorResponse ( 503 , "NoAgent" , "No agent loaded. To continue processing, a " "model of a trained agent needs to be loaded." , help_url = _docs ( "/server.html#running-the-http-server" ) ) return f ( * args , ** kwargs ) return decorated return decorator
Wraps a request handler ensuring there is a loaded and usable model.
Wraps a request handler ensuring there is a loaded and usable model .
"""Wraps a request handler ensuring there is a loaded and usable model."""
app