GiantAnalytics commited on
Commit
3b045d0
·
verified ·
1 Parent(s): 327546f

Update rag_agent.py

Browse files
Files changed (1) hide show
  1. rag_agent.py +9 -9
rag_agent.py CHANGED
@@ -29,18 +29,18 @@ if not os.path.exists(BNI_DATA_PATH):
29
  raise FileNotFoundError(f"❌ Error: The BNI data file {BNI_DATA_PATH} is missing.")
30
 
31
  # 1️⃣ **Convert CSV to JSON for structured retrieval**
32
- def convert_csv_to_json():
33
- df = pd.read_csv(BNI_CSV_FILE)
34
- json_data = df.to_dict(orient="records")
35
 
36
- with open(BNI_JSON_FILE, "w") as file:
37
- json.dump(json_data, file, indent=4)
38
 
39
- print(f"✅ Converted {BNI_CSV_FILE} to JSON format.")
40
 
41
- # Run the conversion **only if JSON does not exist**
42
- if not os.path.exists(BNI_JSON_FILE):
43
- convert_csv_to_json()
44
 
45
 
46
  # 2️⃣ **Create a Vector Database for RAG**
 
29
  raise FileNotFoundError(f"❌ Error: The BNI data file {BNI_DATA_PATH} is missing.")
30
 
31
  # 1️⃣ **Convert CSV to JSON for structured retrieval**
32
+ # def convert_csv_to_json():
33
+ # df = pd.read_csv(BNI_CSV_FILE)
34
+ # json_data = df.to_dict(orient="records")
35
 
36
+ # with open(BNI_JSON_FILE, "w") as file:
37
+ # json.dump(json_data, file, indent=4)
38
 
39
+ # print(f"✅ Converted {BNI_CSV_FILE} to JSON format.")
40
 
41
+ # # Run the conversion **only if JSON does not exist**
42
+ # if not os.path.exists(BNI_JSON_FILE):
43
+ # convert_csv_to_json()
44
 
45
 
46
  # 2️⃣ **Create a Vector Database for RAG**