跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

cf.llm.prompt.token_count

cf.llm.prompt.token_countNumber

请求中 LLM 提示词的估算令牌数。

该数量使用通用分词器计算,可能与您的 LLM 提供商报告的数量不完全一致。

需要 Cloudflare Enterprise 计划。您还必须启用 AI Security for Apps。

用法示例:

# Matches requests where the estimated token count exceeds 4,000:
(cf.llm.prompt.token_count gt 4000)
类别:
  • Request

这篇文档对您有帮助吗?