mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-28 01:32:09 +08:00
8 lines
190 B
TypeScript
8 lines
190 B
TypeScript
import { encode } from "@nem035/gpt-3-encoder";
|
|
|
|
export const openAIApiKey = process.env.OPENAI_API_KEY;
|
|
|
|
export const countTextTokens = (text: string) => {
|
|
return encode(text).length;
|
|
};
|