Closed jschulman closed 1 month ago
can you set DEBUG_RAG_API=True
in your .env file and see if you can recreate the error?
I've run it through a wide variety of PDFs. There is something unique about this PDF that it doesn't like. Debug logs below. Here is the PDF metadata:
_kMDItemDisplayNameWithExtensions = "name.pdf" com_apple_metadata_modtime = 735652485 kMDItemContentCreationDate = 2024-04-24 11:54:45 +0000 kMDItemContentCreationDate_Ranking = 2024-05-15 00:00:00 +0000 kMDItemContentModificationDate = 2024-04-24 11:54:45 +0000 kMDItemContentType = "com.adobe.pdf" kMDItemContentTypeTree = ( "com.adobe.pdf", "public.data", "public.item", "public.composite-content", "public.content" ) kMDItemDateAdded = 2024-05-15 04:06:30 +0000 kMDItemDisplayName = "name.pdf" kMDItemDocumentIdentifier = 415425 kMDItemFSContentChangeDate = 2024-04-24 11:54:45 +0000 kMDItemFSCreationDate = 2024-04-24 11:54:45 +0000 kMDItemFSCreatorCode = "" kMDItemFSFinderFlags = 0 kMDItemFSHasCustomIcon = (null) kMDItemFSInvisible = 0 kMDItemFSIsExtensionHidden = 0 kMDItemFSIsStationery = (null) kMDItemFSLabel = 0 kMDItemFSName = "name.pdf" kMDItemFSNodeCount = (null) kMDItemFSOwnerGroupID = 20 kMDItemFSOwnerUserID = 501 kMDItemFSSize = 488604 kMDItemFSTypeCode = "" kMDItemInterestingDate_Ranking = 2024-05-18 00:00:00 +0000 kMDItemKind = "PDF document" kMDItemLastUsedDate = 2024-05-18 17:52:12 +0000 kMDItemLastUsedDate_Ranking = 2024-05-18 00:00:00 +0000 kMDItemLogicalSize = 488604 kMDItemPhysicalSize = 488604 kMDItemUseCount = 9 kMDItemUsedDates = ( "2024-05-12 05:00:00 +0000", "2024-05-18 05:00:00 +0000" )
LOGS:
rag_api | 2024-05-19 20:00:47,000 - root - DEBUG - /query - {'id': 'x', 'username': 'x', 'provider': 'local', 'email': 'x', 'iat': x, 'exp': x}
rag_api | 2024-05-19 20:00:47,032 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): openaipublic.blob.core.windows.net:443
rag_api | 2024-05-19 20:00:47,307 - urllib3.connectionpool - DEBUG - https://openaipublic.blob.core.windows.net:443 "GET /encodings/cl100k_base.tiktoken HTTP/1.1" 200 1681126
rag_api | 2024-05-19 20:00:47,839 - openai._base_client - DEBUG - Request options: {'method': 'post', 'url': '/embeddings', 'files': None, 'post_parser': <function Embeddings.create.
I've "fixed" this issue and it seems that MongoDB Atlas reliably produces it by not returning any results. They are now handled but mongodb integration will have to go through more extensive review.
Within LibreChat using a git pull from this morning and updated .env and librachat.yml files, I attach a PDF and submit the prompt. I get error "An error occurred while processing your request." This is the log files:
rag_api | 2024-05-19 01:58:23,615 - root - INFO - Request POST http://rag_api:8000/embed - 200 rag_api | 2024-05-19 01:58:32,233 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK" rag_api | 2024-05-19 01:58:32,353 - root - ERROR - list index out of range rag_api | 2024-05-19 01:58:32,353 - root - INFO - Request POST http://rag_api:8000/query - 500 LibreChat | 2024-05-19 01:58:32 error: Error creating context: Request failed with status code 500 LibreChat | 2024-05-19 01:58:32 error: [handleAbortError] AI response error; aborting request: Request failed with status code 500