From 2a11d434539be011be42e2ad7337fe152e6b10ce Mon Sep 17 00:00:00 2001 From: xbrxr03 Date: Wed, 8 Jul 2026 16:44:30 -0400 Subject: [PATCH] fix: make RAG file-type detection case-insensitive Uppercase/mixed-case extensions (.PDF, .Docx, .CSV) were silently misrouted to the text loader instead of the correct parser, causing binary content to be embedded into the RAG store. Lowercase the path before matching against the extension map so that Report.PDF resolves to PDF_FILE, data.CSV to CSV, etc. Closes #6399 --- lib/crewai-tools/src/crewai_tools/rag/data_types.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crewai-tools/src/crewai_tools/rag/data_types.py b/lib/crewai-tools/src/crewai_tools/rag/data_types.py index 27ee48abb0..55eff96349 100644 --- a/lib/crewai-tools/src/crewai_tools/rag/data_types.py +++ b/lib/crewai-tools/src/crewai_tools/rag/data_types.py @@ -123,8 +123,9 @@ def get_file_type(path: str) -> DataType | None: ".xml": DataType.XML, ".txt": DataType.TEXT_FILE, } + lower_path = path.lower() for ext, dtype in mapping.items(): - if path.endswith(ext): + if lower_path.endswith(ext): return dtype return None