Spaces:
Runtime error
Runtime error
Commit History
-
fix: Batch document additions to avoid ChromaDB size limitβ
Julien Simon +1: Claude Opus 4.5ChromaDB has a max batch size of 5461 documents. When adding large numbers of chunks (e.g., 59336), the upsert fails. Added batching function to split documents into chunks of 5000. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>35ad3d5
-
fix: Address code review security and quality issuesβ
Julien Simon +1: Claude Opus 4.5Security fixes: - Add path traversal protection via document filter allowlist - Add input length validation (MAX_QUERY_LENGTH=10000) - Add Gradio rate limiting (queue with max_size=20, concurrency=2) Code quality improvements: - Replace sys.exit() with FileNotFoundError in vectorstore.py - Fix lazy loading retry loop in qa_chain.py using sentinel pattern - Add error logging for silent failures in retrievers.py - Optimize O(n*m) to O(n) document matching in hybrid search - Make EMBEDDING_MODEL and RERANKER_MODEL configurable via env vars - Add proper exports to ui/__init__.py - Remove unused dependencies (streamlit, pandas, plotly) Test updates: - Update tests for new exception types and function signatures π€ Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1521cd2
-
Refactor codebase for improved maintainability and readabilityβ
Julien Simon- Split monolithic files into logical modules: * config.py: Centralized configuration constants * models.py: LLM and embedding model creation * vectorstore.py: Vectorstore management * retrievers.py: Retrieval strategies (MMR, similarity, hybrid) * qa_chain.py: QA chain wrapper with streaming support * utils.py: Utility functions (formatting, chat history) * ui/: UI components separated into app.py, components.py, handlers.py * cli.py: CLI entry point (replaces demo.py) - Improvements: * Removed dead code (format_sources function) * Fixed bug in format_context_with_highlight * Added error handling for empty collections * Fixed missing imports * Improved code organization and separation of concerns - All functionality preserved and testedc319b15