feat: add DocumentCapableInterface for PDF/document support - #117
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a robust mechanism for LLM providers to declare and communicate their document processing capabilities. By defining a new Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Automated approval for solo maintainer project
This PR has passed all automated quality gates:
- ✅ Static analysis (PHPStan)
- ✅ Code style (PHP-CS-Fixer)
- ✅ Unit & functional tests
- ✅ Security scanning
- ✅ Dependency review
See SECURITY_CONTROLS.md for compensating controls documentation.
There was a problem hiding this comment.
Code Review
This pull request successfully introduces the "DocumentCapableInterface" to standardize how LLM providers declare their document processing capabilities. The implementation in "ClaudeProvider" and "GeminiProvider" is straightforward and correctly reflects their PDF support. The accompanying unit tests provide good coverage for the new functionality. Overall, this is a well-structured and valuable feature addition.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #117 +/- ##
=========================================
Coverage 93.88% 93.89%
- Complexity 2137 2141 +4
=========================================
Files 82 82
Lines 7589 7597 +8
=========================================
+ Hits 7125 7133 +8
Misses 464 464
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a provider-level capability contract for document (PDF) support so consumers can query support per provider instead of hardcoding format lists.
Changes:
- Introduces
DocumentCapableInterfacewithsupportsDocuments()andgetSupportedDocumentFormats(). - Implements the interface in
ClaudeProviderandGeminiProvider, both reporting PDF support. - Extends unit tests for Claude/Gemini providers to cover document capability and to assert PDF is not treated as an image format.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Classes/Provider/Contract/DocumentCapableInterface.php | New capability contract to expose document support and formats. |
| Classes/Provider/ClaudeProvider.php | Implements document capability methods and declares PDF support. |
| Classes/Provider/GeminiProvider.php | Implements document capability methods and declares PDF support. |
| Tests/Unit/Provider/ClaudeProviderTest.php | Adds unit tests for document capability + ensures image formats exclude PDF. |
| Tests/Unit/Provider/GeminiProviderTest.php | Adds unit tests for document capability + ensures image formats exclude PDF. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Automated approval for solo maintainer project
This PR has passed all automated quality gates:
- ✅ Static analysis (PHPStan)
- ✅ Code style (PHP-CS-Fixer)
- ✅ Unit & functional tests
- ✅ Security scanning
- ✅ Dependency review
See SECURITY_CONTROLS.md for compensating controls documentation.
Summary
DocumentCapableInterfacewithsupportsDocuments(): boolandgetSupportedDocumentFormats(): arrayClaudeProviderandGeminiProviderimplement the interface, both declaring PDF supportOpenAiProviderdoes not implement the interface — PDF upload via OpenAI requires the Files API and is not supportedTest plan
ClaudeProviderTest:supportsDocumentsReturnsTrue,getSupportedDocumentFormatsReturnsPdfGeminiProviderTest: same tests