Spaces:
Runtime error
Runtime error
Commit Β·
f300018
1
Parent(s): 2ea4404
Remove duplicate mis-indented try/except block; fix runtime error
Browse files- enhanced_rag_chatbot.py +0 -14
enhanced_rag_chatbot.py
CHANGED
|
@@ -60,21 +60,7 @@ class EnhancedRAGChatbot:
|
|
| 60 |
|
| 61 |
# Conversation history
|
| 62 |
self.conversation_history: List[Dict[str, str]] = []
|
| 63 |
-
|
| 64 |
print("β
Enhanced RAG Chatbot with Groq ready!")
|
| 65 |
-
|
| 66 |
-
try:
|
| 67 |
-
self.collection = self.client.get_collection("rackspace_knowledge")
|
| 68 |
-
except Exception as e:
|
| 69 |
-
print("β Vector DB or collection missing! Attempting to rebuild...")
|
| 70 |
-
try:
|
| 71 |
-
import subprocess
|
| 72 |
-
subprocess.run(["python", "enhanced_vector_db.py"], check=True)
|
| 73 |
-
self.collection = self.client.get_collection("rackspace_knowledge")
|
| 74 |
-
print("β
Vector DB rebuilt successfully!")
|
| 75 |
-
except Exception as rebuild_e:
|
| 76 |
-
print("β Failed to rebuild vector DB. Please run 'python enhanced_vector_db.py' manually.")
|
| 77 |
-
self.collection = None
|
| 78 |
"""Retrieve relevant context with source information"""
|
| 79 |
# Generate query embedding
|
| 80 |
query_embedding = self.embedding_model.encode([query])[0]
|
|
|
|
| 60 |
|
| 61 |
# Conversation history
|
| 62 |
self.conversation_history: List[Dict[str, str]] = []
|
|
|
|
| 63 |
print("β
Enhanced RAG Chatbot with Groq ready!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
"""Retrieve relevant context with source information"""
|
| 65 |
# Generate query embedding
|
| 66 |
query_embedding = self.embedding_model.encode([query])[0]
|