# string.gpt 库模块帮助文档

## string.gpt 成员列表 <a id="string.gpt" href="#string.gpt">&#x23;</a>

用于快速估算 OpenAI GPT4o/GPT5 的 token 计数。  
其他大模型建议改用 mmseg.llmTokens 函数估算。

### string.gpt.tokens(字符串) <a id="string.gpt.tokens" href="#string.gpt.tokens">&#x23;</a>
快速估算 token 数。  
参数 @1 指定要计算的字符串，参数 @2 为保留参数请不要指定任何值。  
返回值可调用 math.format.size(tokens," tokens") 函数格式化为类似“21K tokens”的文本。
