get_app
get_app
Get the fully initialized FastAPI application instance. If the app has not been
created yet, this method initializes it with all routes, middleware, health checks,
and security headers — the same configuration that serve() would create.
This is primarily used with deployment adapters like Mangum (AWS Lambda) or when embedding the agent in a larger FastAPI application.
To add routers or static files to the agent’s own app, use
mount() rather
than get_app().include_router(...). Routes added by hand land behind the
agent’s catch-all route and never run.
Parameters
None.
Returns
FastAPI — The configured FastAPI application instance with all agent endpoints
registered.