mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-23 09:28:06 +08:00
## Description This PR fixes critical bugs and improves the robustness of the RAG reranking module while maintaining **100% backward compatibility** with all existing functionality and providers. ## Key Changes 1. **Network Stability**: Added 30s timeout to all API requests to prevent service blocking 2. **Boundary Protection**: Added empty query/text validation for all rerank models 3. **Response Fault Tolerance**: Replaced hardcoded key access with `.get()` to avoid KeyError crashes 4. **Bug Fixes**: - Fixed `Ai302Rerank` (completely non-functional before) - Fixed `GPUStackRerank` incorrect exception catching - Fixed `_normalize_rank` empty array crash 5. **Code Specification**: Added type annotations, standardized unimplemented class prompts ## Compatibility - ✅ No changes to any class/method names - ✅ All rerank providers (Jina/Cohere/NVIDIA/HuggingFace etc.) work as before - ✅ No breaking changes, zero impact on existing workflows ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) - [x] Refactoring --------- Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>