Download src/app/api/analytics/diversity/route.ts from rais133/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/app/api/analytics/diversity/route.ts
- Command line
-
hf download hf://spaces/rais133/omniroute/src/app/api/analytics/diversity/route.ts
-
curl -L -o route.ts https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/app/api/analytics/diversity/route.ts
496 Bytes
| import { NextResponse } from "next/server"; | |
| import { getDiversityReport } from "../../../../../open-sse/services/autoCombo/providerDiversity"; | |
| import { sanitizeErrorMessage } from "@omniroute/open-sse/utils/error"; | |
| export const dynamic = "force-dynamic"; | |
| export async function GET() { | |
| try { | |
| const report = getDiversityReport(); | |
| return NextResponse.json(report); | |
| } catch (error: unknown) { | |
| return NextResponse.json({ error: sanitizeErrorMessage(error) }, { status: 500 }); | |
| } | |
| } | |