INNER CODE UNIT · Python

register_routes

agentscope-ai/agentscope-runtime · src/agentscope_runtime/sandbox/manager/server/app.py:190

def register_routes(_app, instance):
    for _, method in inspect.getmembers(
        instance,
        predicate=inspect.ismethod,
    ):
        if getattr(method, "_is_remote_wrapper", False):
            http_method = method._http_method.lower()
            path = method._path

            endpoint = create_endpoint(method)

            if http_method == "get":
                _app.get(path)(endpoint)
            elif http_method == "post":
                _app.post(path)(endpoint)
            elif http_method == "delete":
                _app.delete(path)(endpoint)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…