-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(provider/anthropic): Url support for pdfs and images in tool results #9733
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
Conversation
|
Lots of lines changed, can you try reverting the lockfile? |
|
changes look good for v6 |
|
@lgrammel All done |
|
@nlaz can you allow changes by maintainers on this PR? i want to make a few minor tweaks to the tests |
packages/anthropic/src/convert-to-anthropic-messages-prompt.test.ts
Outdated
Show resolved
Hide resolved
packages/anthropic/src/convert-to-anthropic-messages-prompt.test.ts
Outdated
Show resolved
Hide resolved
packages/anthropic/src/convert-to-anthropic-messages-prompt.test.ts
Outdated
Show resolved
Hide resolved
|
Or you can update the test file. Ideally in the future edits by maintainers would be allowed. |
|
Test has been updated. I don't have the option in GH to open it up to edit by maintainers. Maybe its because the fork was made on a org account. Will try PRs via personal account in the future |
Background
Now that v6 has
image-urlandfile-urlthis makes it simple to support pdfs and images in the anthropic tool results blocks.This PR adds support for url-based PDFs in tool results. This is a pretty common way to fetch and insert PDF without blowing up the context window. Anthropic's API handles this out of the box. Just needed to update the types on the tool result handling.
Summary
Uses the
image-urlandfile-urltypes to send urls to the provider.Manual Verification
Used the example files to verify the functionality.
Checklist
pnpm changesetin the project root)Related Issues
Hacky Backport: #9503
Related: #9041
Fixes #8014