-
Notifications
You must be signed in to change notification settings - Fork 6.3k
fix: improve input token handling for anthropic metadata usage #7643
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
base: dev
Are you sure you want to change the base?
Conversation
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
https://github.com/vercel/ai/blob/ai%405.0.97/packages/anthropic/src/anthropic-messages-language-model.ts#L1ai269 |
|
Hi, my fixes to ai-sdk/anthropic has been merged, only need to update it to 3.0.10, it will be fix. I will do update pr asap |
|
@hank9999 Upgrading from v2 to v3 seems to be a breaking change |
maybe, but i have seen v3 sdk in project. opencode/packages/opencode/package.json Line 61 in 05019da
opencode/packages/opencode/package.json Line 53 in 05019da
I think it's not too hard to do update. |
|
@hank9999 I noticed that the data structure of ai sdk usage has changed between v2 and v3 versions; I'll need to review the related code when I have time. Or you could take a look and help submit a PR, much appreciated |
|
@caozhiyuan Hi, I find a sad fact, there were a version number mass in ai-sdk. Actually, all packages in project are V2, although the version number is 3.0, such as ai-sdk/[email protected], it's V2! |
|
This PR is the best solution in this case. ): |
|
@rekram1-node can help review and merge it ? |
What does this PR do?
fix #7481
How did you verify your code works?
run

bun dev .and input prompt