-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(provider/anthropic): export convertToAnthropicMessagesPrompt
#8314
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: main
Are you sure you want to change the base?
feat(provider/anthropic): export convertToAnthropicMessagesPrompt
#8314
Conversation
PR looks good, should we get this merged and released? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a new feature, can you add docs for it? Best place is probably a new section in https://github.com/vercel/ai/blob/ae859ceb7aacd17cd72f6d32ed335babf3fc5c3b/content/providers/01-ai-sdk-providers/05-anthropic.mdx. You can add the example from #7526 or something similar?
@gr2m thanks for the review! I documented the new feature and fixed the prettier CI check. |
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
|
||
console.log(`Estimated tokens: ${tokenCount.input_tokens}`); | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is in the right place, it's in the middle of the Language Models section:
https://ai-sdk.dev/providers/ai-sdk-providers/anthropic#language-models
Maybe add a whole new section to the bottom, below ## Code Execution
? I requested a review by @nicoalbanese to help with the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gr2m
I moved it after ## Code Execution
I would love to enhance it more if needed. is there a way to run the docs website locally?
convertToAnthropicMessagesPrompt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the assumption that you can export the convertToAnthropicMessagesPrompt
and pass in model messages is wrong.
have you tested this to check if it works at all? or is the intention that is should be used with LanguageModelV2Prompt
?
Background
To be able to convert messages type to acceptable type of Anthropic SDKs
Summary
export
convertToAnthropicMessagesPrompt
from@ai-sdk/anthropic
Manual Verification
Tasks
pnpm changeset
in the project root)pnpm prettier-fix
in the project root)Related Issues
closes #7526
closes #7522