Spaces:
Running
Running
Update chat/rag_engine.py
Browse files- chat/rag_engine.py +12 -1
chat/rag_engine.py
CHANGED
|
@@ -336,6 +336,17 @@ class GuidelineDetector:
|
|
| 336 |
'coverage_percentage': round(coverage_percentage, 1) if guidelines_to_check else 0
|
| 337 |
}
|
| 338 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 339 |
|
| 340 |
# Import existing modules
|
| 341 |
try:
|
|
@@ -345,7 +356,7 @@ try:
|
|
| 345 |
from chat.comparator import CrossPaperComparator
|
| 346 |
from chat.gap_analyzer import ResearchGapAnalyzer
|
| 347 |
from lib.memory_manager import ConversationMemory
|
| 348 |
-
from llm.llm_provider import XAIGrokProvider
|
| 349 |
except ImportError as e:
|
| 350 |
print(f"⚠️ Some dependencies not found - using simplified mode: {e}")
|
| 351 |
|
|
|
|
| 336 |
'coverage_percentage': round(coverage_percentage, 1) if guidelines_to_check else 0
|
| 337 |
}
|
| 338 |
|
| 339 |
+
# ADD THIS AT THE VERY TOP OF rag_engine.py (before any other imports)
|
| 340 |
+
import sys
|
| 341 |
+
import os
|
| 342 |
+
|
| 343 |
+
# Add the project root to Python path
|
| 344 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 345 |
+
parent_dir = os.path.dirname(current_dir) # This goes from chat/ to MedSearchPro/
|
| 346 |
+
|
| 347 |
+
if parent_dir not in sys.path:
|
| 348 |
+
sys.path.insert(0, parent_dir)
|
| 349 |
+
|
| 350 |
|
| 351 |
# Import existing modules
|
| 352 |
try:
|
|
|
|
| 356 |
from chat.comparator import CrossPaperComparator
|
| 357 |
from chat.gap_analyzer import ResearchGapAnalyzer
|
| 358 |
from lib.memory_manager import ConversationMemory
|
| 359 |
+
from llm.llm_provider import XAIGrokProvider, GrokLLM
|
| 360 |
except ImportError as e:
|
| 361 |
print(f"⚠️ Some dependencies not found - using simplified mode: {e}")
|
| 362 |
|