UNPKG

@lobehub/chat

Version:

Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.

21 lines (14 loc) 533 B
import { getServerDB } from '@/database/core/db-adaptor'; import { asyncAuth } from './asyncAuth'; import { asyncTrpc } from './init'; export const publicProcedure = asyncTrpc.procedure; export const asyncRouter = asyncTrpc.router; export const asyncAuthedProcedure = asyncTrpc.procedure.use(asyncAuth).use( asyncTrpc.middleware(async (opts) => { const serverDB = await getServerDB(); return opts.next({ ctx: { serverDB }, }); }), ); export const createAsyncCallerFactory = asyncTrpc.createCallerFactory;