Commit ·
fa367c4
1
Parent(s): 840df5f
feat: add load_files utility to parse policy and product JSON data
Browse files
app.py
CHANGED
|
@@ -6,7 +6,16 @@ from langchain_community.vectorstores import Qdrant
|
|
| 6 |
from langchain_huggingface import HuggingFaceEmbeddings
|
| 7 |
import requests
|
| 8 |
import os
|
|
|
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
# -----------------------------
|
| 11 |
# 1. Embeddings model
|
| 12 |
# -----------------------------
|
|
|
|
| 6 |
from langchain_huggingface import HuggingFaceEmbeddings
|
| 7 |
import requests
|
| 8 |
import os
|
| 9 |
+
import json
|
| 10 |
|
| 11 |
+
def load_files():
|
| 12 |
+
with open("policies.json", "r", encoding="utf-8") as f:
|
| 13 |
+
policies = json.load(f)
|
| 14 |
+
|
| 15 |
+
with open("products.json", "r", encoding="utf-8") as f:
|
| 16 |
+
products = json.load(f)
|
| 17 |
+
|
| 18 |
+
return policies, products
|
| 19 |
# -----------------------------
|
| 20 |
# 1. Embeddings model
|
| 21 |
# -----------------------------
|