perf: token count (#1509)

This commit is contained in:
Archer
2024-05-16 17:05:56 +08:00
committed by GitHub
parent 6067f5aff3
commit 2d1ec9b3ad
4 changed files with 3 additions and 19 deletions

View File

@@ -16,8 +16,8 @@ async function handler(
req: ApiRequestProps<tokenBody, tokenQuery>,
res: ApiResponseType<any>
): Promise<tokenResponse> {
await authCert({ req, authRoot: true });
const start = Date.now();
await authCert({ req, authRoot: true });
const tokens = await countGptMessagesTokens(req.body.messages);