Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

187 B
Raw Blame
import { estimateTokenCount } from 'tokenx';

export const encodeAsync = async (str: string): Promise<number> => {
  if (str.length === 0) return 0;

  return estimateTokenCount(str);
};