tlsgy commited on
Commit ยท
4e58a89
1
Parent(s): c4dc4b7
dd
Browse files
app.py
CHANGED
|
@@ -50,15 +50,16 @@ def get_csv_file(docs):
|
|
| 50 |
return data
|
| 51 |
|
| 52 |
def get_json_file(docs):
|
|
|
|
| 53 |
json_data = json.loads(docs)
|
| 54 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
| 55 |
temp_filepath = os.path.join(temp_dir.name, docs.name) # JSON ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
| 56 |
|
| 57 |
with open(temp_filepath, "w") as json_file: # JSON ํ์ผ์ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
| 58 |
json.dump(json_data, json_file) # ๋ฐ์ดํฐ๋ฅผ JSON ํ์ผ์ ์์ฑํฉ๋๋ค.
|
| 59 |
-
|
| 60 |
loader = JSONLoader(
|
| 61 |
-
|
| 62 |
jq_schema='.messages[].content',
|
| 63 |
text_content=False
|
| 64 |
)
|
|
|
|
| 50 |
return data
|
| 51 |
|
| 52 |
def get_json_file(docs):
|
| 53 |
+
'''
|
| 54 |
json_data = json.loads(docs)
|
| 55 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
| 56 |
temp_filepath = os.path.join(temp_dir.name, docs.name) # JSON ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
| 57 |
|
| 58 |
with open(temp_filepath, "w") as json_file: # JSON ํ์ผ์ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
| 59 |
json.dump(json_data, json_file) # ๋ฐ์ดํฐ๋ฅผ JSON ํ์ผ์ ์์ฑํฉ๋๋ค.
|
| 60 |
+
'''
|
| 61 |
loader = JSONLoader(
|
| 62 |
+
file_content=docs,
|
| 63 |
jq_schema='.messages[].content',
|
| 64 |
text_content=False
|
| 65 |
)
|