Spaces:
Build error
Build error
Bug fix on collection name
Browse files- app/utils/doc_ingest.py +3 -5
app/utils/doc_ingest.py
CHANGED
|
@@ -1,16 +1,14 @@
|
|
| 1 |
# utils/doc_ingest.py
|
| 2 |
from .chat_rag import pdf_to_vec
|
| 3 |
|
| 4 |
-
def ingest_document(file_location: str,
|
| 5 |
"""
|
| 6 |
Process and ingest a document into a user-specific vector database.
|
| 7 |
|
| 8 |
:param file_location: The location of the uploaded file on the server.
|
| 9 |
-
:param
|
| 10 |
"""
|
| 11 |
-
|
| 12 |
-
collection_name = f"user_{user_id}_collection"
|
| 13 |
-
|
| 14 |
try:
|
| 15 |
vectordb = pdf_to_vec(file_location, collection_name)
|
| 16 |
print("Document processed and ingested successfully into user-specific collection.")
|
|
|
|
| 1 |
# utils/doc_ingest.py
|
| 2 |
from .chat_rag import pdf_to_vec
|
| 3 |
|
| 4 |
+
def ingest_document(file_location: str, collection_name: str):
|
| 5 |
"""
|
| 6 |
Process and ingest a document into a user-specific vector database.
|
| 7 |
|
| 8 |
:param file_location: The location of the uploaded file on the server.
|
| 9 |
+
:param collection_name: The collection name unique for each user uploading the document.
|
| 10 |
"""
|
| 11 |
+
|
|
|
|
|
|
|
| 12 |
try:
|
| 13 |
vectordb = pdf_to_vec(file_location, collection_name)
|
| 14 |
print("Document processed and ingested successfully into user-specific collection.")
|