-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[错误]: Claude 3.7 Sonnet 无法使用 128k 的 max_tokens #2877
Comments
应该是官方API不支持128k吧。之前我调用SDK出错了,把这里代码回滚了。还没测试,如果测试通过下个版本就加上128k的支持 |
这不是app的问题,是接口返回的错误信息。 实际上sonnet 3.7的max output 是 8K / Extended thinking: 64000 tokens,如下: |
这个似乎是正式版的最长限制,beta 版能再长一点,我上面发的链接里有关于 128k |
正式版暂时是 64k,beta 版支持到 128k,所以希望软件能把 beta 版需要的 header 加上,或者在检测到用户输入了大于 64k 的 max_tokens 时把 header 带上 |
@DeJeune 我们之前参数加错了,加到 body 里面去了,应该是要加到 header 里面 |
提交前检查
平台
macOS
版本
v1.0.5
错误描述
当前的
DEFAULT_MAX_TOKENS
太小,所以打开了开启消息长度限制,并设置为 128000,报错如下:但是多传递一个 header 就能开启 128k,参考:https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking#extended-output-capabilities-beta
顺便说下,是否考虑过对不同模型启用不同的
DEFAULT_MAX_TOKENS
,带 CoT 的模型会消耗很多 token 在思考上,当前的默认值感觉有点限制这些模型的能力了重现步骤
NOP
预期行为
NOP
相关日志输出
附加信息
No response
The text was updated successfully, but these errors were encountered: