surfiniaburger commited on
Commit
9abd4ea
·
1 Parent(s): 796eef1
Files changed (1) hide show
  1. knowledge_base.py +11 -7
knowledge_base.py CHANGED
@@ -20,17 +20,21 @@ class KnowledgeBase:
20
  self._build_initial_knowledge_base()
21
 
22
  def _build_initial_knowledge_base(self):
23
- document_files = [
24
- "/Users/surfiniaburger/Desktop/glow/aura-mind-glow/knowledge_base_data/healthy_maize_remedy.txt",
25
- "/Users/surfiniaburger/Desktop/glow/aura-mind-glow/knowledge_base_data/maize_phosphorus_deficiency_remedy.txt",
26
- "/Users/surfiniaburger/Desktop/glow/aura-mind-glow/knowledge_base_data/comic_relief.txt"
 
 
 
27
  ]
 
28
  documents_content = {}
29
- for file_path in document_files:
 
30
  try:
31
  with open(file_path, 'r', encoding='utf-8') as f:
32
- # Use the base name of the file as the document name
33
- documents_content[os.path.basename(file_path)] = f.read()
34
  except FileNotFoundError:
35
  print(f"Warning: Knowledge base file not found, skipping: {file_path}")
36
 
 
20
  self._build_initial_knowledge_base()
21
 
22
  def _build_initial_knowledge_base(self):
23
+ current_dir = os.path.dirname(__file__)
24
+ knowledge_base_data_dir = os.path.join(current_dir, "knowledge_base_data")
25
+
26
+ document_filenames = [
27
+ "healthy_maize_remedy.txt",
28
+ "maize_phosphorus_deficiency_remedy.txt",
29
+ "comic_relief.txt"
30
  ]
31
+
32
  documents_content = {}
33
+ for filename in document_filenames:
34
+ file_path = os.path.join(knowledge_base_data_dir, filename)
35
  try:
36
  with open(file_path, 'r', encoding='utf-8') as f:
37
+ documents_content[filename] = f.read()
 
38
  except FileNotFoundError:
39
  print(f"Warning: Knowledge base file not found, skipping: {file_path}")
40