Repository navigation
feat(studio): configurable RAG upload extensions via RAG_UPLOAD_EXTS - #11499
Conversation
Add RAG_UPLOAD_EXTS so linked folders and uploads can restrict indexed file types without patching config.py. Defaults preserve the existing document extension set. Fixes unslothai#11385
|
Review record for #11499, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#298. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Resolve conflicts with RAG_UPLOAD_EXTS (unslothai#11499) and rework the change: - backend: one SOURCE_TEXT_EXTS set folded into UPLOAD_EXTS, so every caller and the RAG_UPLOAD_EXTS narrowing keep working; parity test against the chat's TEXT_ATTACHMENT_EXTENSIONS instead of a second hand-kept list - NUL rejection only for source extensions, so .txt behaviour is unchanged - folder sync: skip venvs by pyvenv.cfg instead of the name 'env' (Terraform env/ dirs) - frontend: reuse TEXT_ATTACHMENT_EXTENSIONS from source-drop-policy (no barrel cycle), knowledge base picker accepts the same types as its drop zone, drop the extensionless names the backend would 400 on
Fixes #11385
Summary
studio/backend/core/rag/config.pydocumented that every RAG setting is env-overridable, butUPLOAD_EXTSwas hardcoded. This addsRAG_UPLOAD_EXTSas a comma-separated list (same default as today) so linked folders and project uploads can restrict indexed types—for exampleRAG_UPLOAD_EXTS=.md,.markdownfor a mixed notes directory.Changes
RAG_UPLOAD_EXTSintoUPLOAD_EXTS(trim + lowercase)test_rag_config_upload_exts.pycovering defaults, env parsing, and upload gatingNote on #10395
When
ALL_UPLOAD_EXTSlands, maintainers may want the same env var to filter that union; this PR targets currentmainwhere ingestion and folder sync useUPLOAD_EXTS.Testing
pytest studio/backend/tests/test_rag_config_upload_exts.py(not run on this VM — disk quota blocked installing studio deps)