Update app.py
#10
by
JoSuBeen
- opened
app.py
CHANGED
@@ -25,13 +25,18 @@ def get_pdf_text(pdf_docs):
|
|
25 |
# κ³Όμ
|
26 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
27 |
def get_text_file(docs):
|
28 |
-
|
29 |
-
|
30 |
def get_csv_file(docs):
|
31 |
-
|
|
|
|
|
32 |
|
33 |
def get_json_file(docs):
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
|
|
25 |
# κ³Όμ
|
26 |
# μλ ν
μ€νΈ μΆμΆ ν¨μλ₯Ό μμ±
|
27 |
def get_text_file(docs):
|
28 |
+
return [docs.getvalue()] # Return a list with the entire text content as a single element.
|
29 |
+
|
30 |
def get_csv_file(docs):
|
31 |
+
csv_loader = CSVLoader(docs.name) # Assuming CSVLoader takes a file path.
|
32 |
+
csv_doc = csv_loader.load()
|
33 |
+
return csv_doc # Return the content of the CSV document.
|
34 |
|
35 |
def get_json_file(docs):
|
36 |
+
json_loader = JSONLoader(docs.name) # Assuming JSONLoader takes a file path.
|
37 |
+
json_doc = json_loader.load()
|
38 |
+
return json_doc # Return the content of the JSON document.
|
39 |
+
|
40 |
|
41 |
|
42 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|