dungeon29 commited on
Commit
5280e2b
·
verified ·
1 Parent(s): 64b82af

Update rag_engine.py

Browse files
Files changed (1) hide show
  1. rag_engine.py +12 -5
rag_engine.py CHANGED
@@ -17,16 +17,23 @@ class RAGEngine:
17
 
18
  # Qdrant Cloud Configuration
19
  # Prioritize Env Vars, fallback to Hardcoded (User provided)
20
- self.qdrant_url = os.environ.get("QDRANT_URL") or "https://abd29675-7fb9-4d95-8941-e6130b09bf7f.us-east4-0.gcp.cloud.qdrant.io"
21
- self.qdrant_api_key = os.environ.get("QDRANT_API_KEY") or "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOiJtIn0.L0aAAAbxRypLfBeGCtFr2xX06iveGb76NrA3BPJQiNM"
 
 
 
 
 
 
 
22
  self.collection_name = "phishing_knowledge"
23
 
24
- if not self.qdrant_url or not self.qdrant_api_key:
25
- print("⚠️ QDRANT_URL or QDRANT_API_KEY not set. RAG will not function correctly.")
26
  self.vector_store = None
27
  return
28
 
29
- print(f"☁️ Connecting to Qdrant Cloud: {self.qdrant_url}...")
30
 
31
  # Initialize Qdrant Client
32
  self.client = QdrantClient(
 
17
 
18
  # Qdrant Cloud Configuration
19
  # Prioritize Env Vars, fallback to Hardcoded (User provided)
20
+ env_qdrant_url = os.environ.get("QDRANT_URL")
21
+ print(f"DEBUG: QDRANT_URL from env: '{env_qdrant_url}'")
22
+
23
+ self.qdrant_url = env_qdrant_url or "https://abd29675-7fb9-4d95-8941-e6130b09bf7f.us-east4-0.gcp.cloud.qdrant.io"
24
+ self.qdrant_api_key = os.environ.get("QDRANT_API_KEY") # Don't default key if using local URL
25
+
26
+ if not self.qdrant_api_key and "qdrant.io" in self.qdrant_url:
27
+ self.qdrant_api_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3MiOiJtIn0.L0aAAAbxRypLfBeGCtFr2xX06iveGb76NrA3BPJQiNM"
28
+
29
  self.collection_name = "phishing_knowledge"
30
 
31
+ if not self.qdrant_url:
32
+ print("⚠️ QDRANT_URL not set. RAG will not function correctly.")
33
  self.vector_store = None
34
  return
35
 
36
+ print(f"☁️ Connecting to Qdrant: {self.qdrant_url}...")
37
 
38
  # Initialize Qdrant Client
39
  self.client = QdrantClient(