initial commit
Browse files
app.py
CHANGED
@@ -47,7 +47,11 @@ def get_csv_file(csv_docs):
|
|
47 |
csv_doc = csv_loader.load()
|
48 |
return csv_doc
|
49 |
|
50 |
-
def get_json_file():
|
|
|
|
|
|
|
|
|
51 |
json_loader = JSONLoader(
|
52 |
file_path='homework4/facebook_chat.json',
|
53 |
jq_schema='.messages[].content',
|
|
|
47 |
csv_doc = csv_loader.load()
|
48 |
return csv_doc
|
49 |
|
50 |
+
def get_json_file(json_docs):
|
51 |
+
temp_dir = tempfile.TemporaryDirectory()
|
52 |
+
temp_filepath = os.path.join(temp_dir.name, json_docs.name)
|
53 |
+
with open(temp_filepath, "wb") as f:
|
54 |
+
f.write(json_docs.getvalue())
|
55 |
json_loader = JSONLoader(
|
56 |
file_path='homework4/facebook_chat.json',
|
57 |
jq_schema='.messages[].content',
|