-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(provider/perplexity): Add PDF support #10089
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
feat(provider/perplexity): Add PDF support #10089
Conversation
|
Thank for the PR @goyalshivansh2805 Tested it out and works perfectly |
**Background** The Perplexity provider currently doesn't support PDF upload functionality, although the direct Perplexity API supports this feature. Other providers in the AI SDK like OpenAI, Gemini, and Anthropic already have this capability, making the Perplexity implementation incomplete compared to these providers. **Summary** Added PDF support to the Perplexity provider, allowing users to: - Upload PDF files directly using base64 encoding - Reference PDF files via URLs - Include optional filename parameter Implementation includes: - Updated message conversion logic to handle PDF files - Modified PerplexityMessageContent type to include file_url type - Added documentation for PDF support - Created example files demonstrating PDF usage Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root) - [x] I have reviewed this pull request (self-review) Related Issues Fixes: #9803
|
✅ Backport PR created: #10130 |
This is an automated backport of #10089 to the release-v5.0 branch. FYI @goyalshivansh2805 --------- Co-authored-by: Shivansh Goyal <[email protected]> Co-authored-by: josh <[email protected]>
| Please see the [Perplexity docs](https://docs.perplexity.ai) for detailed API | ||
| documentation and the latest updates. | ||
| </Note> | ||
| ``` |
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.
FYI @goyalshivansh2805 @dancer this broke our docs build. Just a note for future PRs to doublecheck that formatters don't add anything like this.
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.
Got it, thanks for pointing that out! I’ll make sure to double-check for any formatter artifacts before pushing future PRs.
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.
thanks!
## Background Docs builds are failing right now due to formatting issue introduced in #10089.
## Background Docs builds are failing right now due to formatting issue introduced in #10089.
Background
The Perplexity provider currently doesn't support PDF upload functionality, although the direct Perplexity API supports this feature. Other providers in the AI SDK like OpenAI, Gemini, and Anthropic already have this capability, making the Perplexity implementation incomplete compared to these providers.
Summary
Added PDF support to the Perplexity provider, allowing users to:
Implementation includes:
Manual Verification
I manually verified the changes by:
Both base64-encoded PDFs and URL-based PDFs work correctly, and the optional filename parameter is properly handled.
Checklist
Related Issues
Fixes: #9803