🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
import {
createUnstablePublicApiRoute,
withUnstablePublicApiMiddlewares,
} from "@/src/features/public-api/server/unstable-public-api-route";
import {
GetUnstableDashboardWidgetsQuery,
GetUnstableDashboardWidgetsResponse,
PostUnstableDashboardWidgetBody,
PostUnstableDashboardWidgetResponse,
} from "@/src/features/public-api/types/unstable-dashboard-widgets";
import {
createPublicDashboardWidget,
listPublicDashboardWidgets,
} from "@/src/features/widgets/server/public-dashboard-widget-service";
export default withUnstablePublicApiMiddlewares({
GET: createUnstablePublicApiRoute({
name: "List Unstable Dashboard Widgets",
action: "dashboards:read",
querySchema: GetUnstableDashboardWidgetsQuery,
responseSchema: GetUnstableDashboardWidgetsResponse,
fn: ({ query, auth }) =>
listPublicDashboardWidgets({ projectId: auth.scope.projectId, ...query }),
}),
POST: createUnstablePublicApiRoute({
name: "Create Unstable Dashboard Widget",
action: "dashboards:CUD",
bodySchema: PostUnstableDashboardWidgetBody,
responseSchema: PostUnstableDashboardWidgetResponse,
fn: async ({ body, auth }) =>
createPublicDashboardWidget({
projectId: auth.scope.projectId,
input: body,
auditScope: auth.scope,
}),
}),
});