han-byeol commited on
Commit
0dbd26a
β€’
1 Parent(s): 2355133

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -48,7 +48,13 @@ def get_csv_file(csv_docs):
48
  return csv_doc
49
 
50
  def get_json_file(json_docs):
51
- pass
 
 
 
 
 
 
52
 
53
 
54
  # λ¬Έμ„œλ“€μ„ μ²˜λ¦¬ν•˜μ—¬ ν…μŠ€νŠΈ 청크둜 λ‚˜λˆ„λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.
 
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(temp_filepath, jq_schema={})
56
+ users_text = json_loader.load()
57
+ return users_text
58
 
59
 
60
  # λ¬Έμ„œλ“€μ„ μ²˜λ¦¬ν•˜μ—¬ ν…μŠ€νŠΈ 청크둜 λ‚˜λˆ„λŠ” ν•¨μˆ˜μž…λ‹ˆλ‹€.