Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何计算待发文本的tokens数 #43

Open
longyue0521 opened this issue Jul 10, 2024 · 0 comments
Open

如何计算待发文本的tokens数 #43

longyue0521 opened this issue Jul 10, 2024 · 0 comments

Comments

@longyue0521
Copy link

longyue0521 commented Jul 10, 2024

@glide-the

请问sdk是否有计算输入tokens数的API? 如果没有, 请问使用 https://github.com/openai/tiktoken 是否可行?

我希望在发送文本前可以粗略计算出 本次花费 = (输入tokens数 * 输入费率 + 本次响应最大tokens限制数 * 响应费率)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant