api_router
What it is
- A FastAPI
APIRouterinstance that aggregates and mounts all API endpoint routers for the Nexus API application.
Public API
api_router: fastapi.APIRouter- Main router that includes sub-routers with defined URL prefixes and tags.
Included sub-routers (mounted on api_router):
/auth(tags=["auth"]) fromauth_router/organizations(tags=["organizations"]) fromorganizations.router/organizations(tags=["organizations-public"]) fromorganizations.public_router/workspaces(tags=["workspaces"]) fromworkspaces_router/chat(tags=["chat"]) fromchat_router/search(tags=["search"]) fromsearch.router/ontology(tags=["ontology"]) fromontology.router/graph(tags=["graph"]) fromgraph.router/view(tags=["view"]) fromview.router/agents(tags=["agents"]) fromagents_router/files(tags=["files"]) fromfiles_router/secrets(tags=["secrets"]) fromsecrets.router/providers(tags=["providers"]) fromproviders_router/websocket(tags=["websocket"]) fromwebsocket.router/abi(tags=["abi"]) fromabi.router/tenant(tags=["tenant"]) fromtenant.router/transcribe(tags=["transcribe"]) fromtranscribe.router
Configuration/Dependencies
- Requires
fastapi(usesfastapi.APIRouter). - Depends on multiple internal routers imported from:
naas_abi.apps.nexus.apps.api.app.api.endpoints.*naas_abi.apps.nexus.apps.api.app.services.*.handlers
Usage
Minimal example mounting this router in a FastAPI application:
from fastapi import FastAPI
from naas_abi.apps.nexus.apps.api.app.api.router import api_router
app = FastAPI()
app.include_router(api_router)
Caveats
- Two routers are mounted under the same prefix
/organizationswith different tags; path conflicts (if any) are determined by FastAPI routing rules and the order of inclusion in this file.