Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
@@ -398,6 +398,7 @@ def create_documents(data_source: str, data: List[dict]) -> List[Document]:
|
|
398 |
return docs
|
399 |
|
400 |
|
|
|
401 |
|
402 |
# 4. Vector Store Integration
|
403 |
|
@@ -419,8 +420,8 @@ class MyVector_Store:
|
|
419 |
# -----------------------------
|
420 |
# Process JSON data and create documents
|
421 |
# -----------------------------
|
422 |
-
with open("
|
423 |
-
|
424 |
|
425 |
docs = create_documents("json", json_data)
|
426 |
texts = [doc.page_content for doc in docs]
|
|
|
398 |
return docs
|
399 |
|
400 |
|
401 |
+
|
402 |
|
403 |
# 4. Vector Store Integration
|
404 |
|
|
|
420 |
# -----------------------------
|
421 |
# Process JSON data and create documents
|
422 |
# -----------------------------
|
423 |
+
with open("data.json", "r", encoding="utf-8") as f:
|
424 |
+
data = json.load(f)
|
425 |
|
426 |
docs = create_documents("json", json_data)
|
427 |
texts = [doc.page_content for doc in docs]
|