mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Add metadata support to Knowledge Source classes
- Implement _coerce_to_records function to handle both string and dict formats - Update KnowledgeStorage.save() to accept list[str] | list[dict[str, Any]] - Add metadata (filepath, chunk_index, source_type) to all Knowledge Source classes: - TextFileKnowledgeSource - PDFKnowledgeSource - CSVKnowledgeSource - JSONKnowledgeSource - ExcelKnowledgeSource (includes sheet_name for multi-sheet files) - StringKnowledgeSource - CrewDoclingSource - Add comprehensive tests for metadata functionality - Maintain backward compatibility with existing string-based chunks Fixes #3812 Co-Authored-By: João <joao@crewai.com>
This commit is contained in: