fix(tools): make RAG file extension detection case-insensitive - #6755
fix(tools): make RAG file extension detection case-insensitive#6755Kyou12138 wants to merge 1 commit into
Conversation
DataTypes.from_content() compared path.endswith(ext) against a lowercase-only map, so .PDF/.CSV/.DOCX were misclassified as text (or website for URLs). Lowercase the path before matching. Closes crewAIInc#6399
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesRAG file-type detection
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Blocked on updating this branch to latest To unblock (one-time, on machine with Kyou12138 login): Or click Update branch in the GitHub UI (if the browser session has full permissions). |
|
Superseded by rebased PR #6883 (CountClaw fork; rebased onto latest main — original fork push blocked by missing |
|
Closing in favor of rebased #6883. |
Summary
Fixes #6399.
DataTypes.from_content()matched file extensions with case-sensitivepath.endswith(ext)against a lowercase-only map. Paths/URLs such asReport.PDFordata.CSVwere misclassified as plain text (orwebsitefor URLs), so binary documents were chunked/embedded as raw bytes instead of parsed text.This is common on Windows, scanner exports, and many enterprise document pipelines.
Change
Lowercase the path (or URL path segment used for extension matching) before comparing against the extension map so detection is case-insensitive for all registered types (PDF, DOCX, CSV, …).
Tests
Added
test_data_types_from_content.pycovering:How to test
Notes
Related open PRs may address the same issue; this change is intentionally minimal (normalize once at match time) with focused unit coverage.