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.

9 lines (6 loc) 246 B
import { encode } from 'gpt-tokenizer/encoding/o200k_base'; import { NextResponse } from 'next/server'; export const POST = async (req: Request) => { const str = await req.text(); return NextResponse.json({ count: encode(str).length }); };