as_router
as_router
Get a FastAPI APIRouter containing all of this agent’s registered routes. This is
the lowest-level integration point for embedding an agent’s endpoints into an
existing FastAPI application.
Use this when you need fine-grained control over how the agent’s routes are
mounted, or when composing multiple agents into a custom application layout. For
multi-agent hosting, consider
AgentServer instead.
Parameters
None.
Returns
HostAppRouter — A FastAPI APIRouter subclass with all agent endpoints (SWML
delivery, SWAIG function handling, post-prompt, debug events, etc.). It adds no
behavior; the subclass exists to give the return type a stable name.