INNER CODE UNIT · Python
_mount_studio_routes
ohdearquant/lionagi · lionagi/studio/app.py:284
def _mount_studio_routes(application: FastAPI) -> None:
"""Add every route registered via the @studio_route decorator to
`application`; importing the area modules here fires the decorators.
"""
load_studio_route_modules()
for _route in iter_studio_routes():
application.add_api_route(
f"/api{_route.path}",
_route.handler,
methods=[_route.method],
**(
{"response_model": _route.response_model}
if _route.response_model is not None
else {}
),
dependencies=list(_route.dependencies),
status_code=_route.status_code,
tags=list(_route.tags),