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

custom jsonloader

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -53,7 +53,7 @@ def get_json_file(json_docs):
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
 
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='.users[].firstName',
57
  text_content=False)
58
  json_doc = json_loader.load()
59
  return json_doc