Commit Graph

2 Commits

Author SHA1 Message Date
Devin AI
77065f2151 fix: Address lint issues in external knowledge directory implementation
- Remove unnecessary variable assignment in paths.py (RET504)
- Add proper exception chaining in crew_docling_source.py and excel_knowledge_source.py (B904)
- Use next(iter(...)) instead of list(...)[0] in test files (RUF015)

Note: N805 error about cls vs self in field_validator is a false positive -
Pydantic field validators correctly use cls as first parameter

Co-Authored-By: João <joao@crewai.com>
2025-09-16 00:20:08 +00:00
Devin AI
101cee8a27 feat: Add support for external knowledge directory via CREWAI_KNOWLEDGE_FILE_DIR
- Add get_knowledge_directory() utility function following CREWAI_STORAGE_DIR pattern
- Update BaseFileKnowledgeSource, CrewDoclingSource, and ExcelKnowledgeSource to use new function
- Add comprehensive tests for utility function and knowledge source integration
- Maintain backward compatibility with default 'knowledge' directory
- Add proper error handling for non-existent directories

Fixes #3519

Co-Authored-By: João <joao@crewai.com>
2025-09-16 00:11:41 +00:00