Spaces:
Sleeping
Sleeping
Commit
·
a0b918a
1
Parent(s):
99f6f5f
fix: add requirement
Browse files- api/function.py +4 -4
- api/router/book.py +4 -3
- requirements.txt +1 -1
api/function.py
CHANGED
@@ -30,11 +30,11 @@ async def data_ingestion(reference, file: UploadFile) -> Any:
|
|
30 |
)
|
31 |
|
32 |
# # Upload to AWS
|
33 |
-
|
34 |
-
|
35 |
|
36 |
-
|
37 |
-
|
38 |
|
39 |
uploader = Uploader(reference, file)
|
40 |
|
|
|
30 |
)
|
31 |
|
32 |
# # Upload to AWS
|
33 |
+
file_name = f"{reference['title']}"
|
34 |
+
aws_loader = Loader()
|
35 |
|
36 |
+
file_obj = file
|
37 |
+
aws_loader.upload_to_s3(file_obj, file_name)
|
38 |
|
39 |
uploader = Uploader(reference, file)
|
40 |
|
api/router/book.py
CHANGED
@@ -64,7 +64,7 @@ async def upload_file(
|
|
64 |
if auth_response:
|
65 |
return auth_response
|
66 |
|
67 |
-
|
68 |
|
69 |
# Query the category based on category_id
|
70 |
category_query = CategoryQuery(user)
|
@@ -83,8 +83,9 @@ async def upload_file(
|
|
83 |
response = await data_ingestion(reference, file)
|
84 |
|
85 |
# Create a new Metadata object
|
86 |
-
|
87 |
-
|
|
|
88 |
|
89 |
return {
|
90 |
"filename": file.filename,
|
|
|
64 |
if auth_response:
|
65 |
return auth_response
|
66 |
|
67 |
+
|
68 |
|
69 |
# Query the category based on category_id
|
70 |
category_query = CategoryQuery(user)
|
|
|
83 |
response = await data_ingestion(reference, file)
|
84 |
|
85 |
# Create a new Metadata object
|
86 |
+
book_query = BookQuery(user)
|
87 |
+
book_query.add_book(db, title, author, category_id, year, publisher)
|
88 |
+
logging.info("Database Inserted")
|
89 |
|
90 |
return {
|
91 |
"filename": file.filename,
|
requirements.txt
CHANGED
@@ -79,7 +79,7 @@ llama-index-readers-file==0.2.1
|
|
79 |
llama-index-readers-llama-parse==0.3.0
|
80 |
llama-index-storage-chat-store-redis==0.2.0
|
81 |
llama-index-vector-stores-pinecone==0.2.1
|
82 |
-
llama-parse==0.5.
|
83 |
Mako==1.3.5
|
84 |
markdown-it-py==3.0.0
|
85 |
MarkupSafe==2.1.5
|
|
|
79 |
llama-index-readers-llama-parse==0.3.0
|
80 |
llama-index-storage-chat-store-redis==0.2.0
|
81 |
llama-index-vector-stores-pinecone==0.2.1
|
82 |
+
llama-parse==0.5.8
|
83 |
Mako==1.3.5
|
84 |
markdown-it-py==3.0.0
|
85 |
MarkupSafe==2.1.5
|