Skip to content

Fix: PDFKnowledgeSource instantiation error (Issue #2619) #2620

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

devin-ai-integration[bot]
Copy link
Contributor

Fix PDFKnowledgeSource instantiation error (Issue #2619)

Problem

Users were unable to instantiate PDFKnowledgeSource with the error: "Can't instantiate abstract class BaseKnowledgeSource without an implementation for abstract methods 'add', 'validate_content'".

Solution

The issue was that BaseFileKnowledgeSource (which PDFKnowledgeSource inherits from) didn't implement the required add() method from BaseKnowledgeSource.

This PR adds the missing add() implementation to BaseFileKnowledgeSource, which completes the inheritance chain and allows PDFKnowledgeSource and other file-based knowledge sources to be instantiated without errors.

Tests

  • Added a new test specifically for verifying PDFKnowledgeSource instantiation
  • Verified existing tests pass
  • Tested manually to confirm the error is resolved

Fixes #2619

Link to Devin run: https://app.devin.ai/sessions/35a90afe7c6c4299b219c2dc01331798
Requested by: Joe Moura (joao@crewai.com)

…owledgeSource instantiation error

Co-Authored-By: Joe Moura <joao@crewai.com>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 3 commits April 16, 2025 12:07
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant