INNER CODE UNIT · Python

index

pathwaycom/llm-app · serviette/frontend/main.py:73

    async def index() -> HTMLResponse:
        return HTMLResponse(index_html)

    @app.get("/api/v1/config")
    async def frontend_config() -> JSONResponse:
        # Informational only (shown in the header); no secrets here.
        return JSONResponse({"title": fe.title, "api_url": fe.api_url})

    async def _proxy(name: str, request: Request) -> JSONResponse:
        try:
            body = await request.json()
        except Exception:  # noqa: BLE001 - any malformed body proxies as empty
            body = {}
        assert client is not None  # created in lifespan before serving
        try:
            upstream = await client.post(_PROXY_ROUTES[name], json=body)
        except httpx.HTTPError as exc:
            return JSONResponse(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…