yunnn426 commited on
Commit
52fa77a
β€’
1 Parent(s): dfbc913

fix jsonloader

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -52,7 +52,9 @@ def get_json_file(json_docs):
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()) # text λ¬Έμ„œμ˜ λ‚΄μš©μ„ μž„μ‹œ νŒŒμΌμ— μ”λ‹ˆλ‹€.
55
- json_loader = JSONLoader(file_path=temp_filepath)
 
 
56
  json_doc = json_loader.load()
57
  return json_doc
58
 
 
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()) # text λ¬Έμ„œμ˜ λ‚΄μš©μ„ μž„μ‹œ νŒŒμΌμ— μ”λ‹ˆλ‹€.
55
+ json_loader = JSONLoader(file_path=temp_filepath,
56
+ jq_schema='.messages[].content',
57
+ text_content=False)
58
  json_doc = json_loader.load()
59
  return json_doc
60