mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-11 08:38:24 +00:00
* refactor: expose core private symbols with compatibility aliases Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * types: narrow core migration diagnostics Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve runtime behavior in core symbol migration Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve core private usage migration behavior Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve private value rebinding compatibility Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: restore optional imports and cover public helpers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: exempt router property from call coverage Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: align recursive detector ignore names Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
31 lines
1.1 KiB
Python
31 lines
1.1 KiB
Python
from fastapi import APIRouter
|
|
from fastapi.responses import Response
|
|
from litellm_enterprise.enterprise_callbacks.send_emails.endpoints import (
|
|
router as email_events_router,
|
|
)
|
|
|
|
from . import ui_crud_endpoints # side-effect: registers extra UI settings
|
|
from .audit_logging_endpoints import router as audit_logging_router
|
|
from .liteadmin import router as liteadmin_router
|
|
from .management_endpoints import management_endpoints_router
|
|
from .utils import should_block_robots
|
|
|
|
__all__ = ["router", "ui_crud_endpoints"]
|
|
|
|
router = APIRouter()
|
|
router.include_router(email_events_router)
|
|
router.include_router(audit_logging_router)
|
|
router.include_router(liteadmin_router)
|
|
router.include_router(management_endpoints_router)
|
|
|
|
|
|
@router.get("/robots.txt")
|
|
async def get_robots():
|
|
"""
|
|
Block all web crawlers from indexing the proxy server endpoints
|
|
This is useful for ensuring that the API endpoints aren't indexed by search engines
|
|
"""
|
|
if should_block_robots():
|
|
return Response(content="User-agent: *\nDisallow: /", media_type="text/plain")
|
|
else:
|
|
return Response(status_code=404)
|