@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.
22 lines (18 loc) • 615 B
text/typescript
import { createTRPCClient, httpBatchLink } from '@trpc/client';
import superjson from 'superjson';
import type { EdgeRouter } from '@/server/routers/edge';
import { withBasePath } from '@/utils/basePath';
export const edgeClient = createTRPCClient<EdgeRouter>({
links: [
httpBatchLink({
headers: async () => {
// dynamic import to avoid circular dependency
const { createHeaderWithAuth } = await import('@/services/_auth');
return createHeaderWithAuth();
},
maxURLLength: 2083,
transformer: superjson,
url: withBasePath('/trpc/edge'),
}),
],
});