Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
@@ -420,8 +420,16 @@ class MyVector_Store:
|
|
420 |
# -----------------------------
|
421 |
# Process JSON data and create documents
|
422 |
# -----------------------------
|
423 |
-
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
|
426 |
docs = create_documents("json", json_data)
|
427 |
texts = [doc.page_content for doc in docs]
|
|
|
420 |
# -----------------------------
|
421 |
# Process JSON data and create documents
|
422 |
# -----------------------------
|
423 |
+
file_path = "/home/wendy/my_hf_agent_course_projects/src/data.json"
|
424 |
+
|
425 |
+
try:
|
426 |
+
with open(file_path, "r", encoding="utf-8") as f:
|
427 |
+
data = json.load(f)
|
428 |
+
print(data)
|
429 |
+
except FileNotFoundError as e:
|
430 |
+
print(f"Error: {e}")
|
431 |
+
except json.JSONDecodeError as e:
|
432 |
+
print(f"Error decoding JSON: {e}")
|
433 |
|
434 |
docs = create_documents("json", json_data)
|
435 |
texts = [doc.page_content for doc in docs]
|