Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Apply suggestion from @Copilot

Edwin Josebb177a721eb3
diff --git a/src/api/upload.py b/src/api/upload.py
index 835a1e8f7..c0227989f 100644
--- a/src/api/upload.py
+++ b/src/api/upload.py
@@ -116,18 +116,7 @@ async def upload_context(
jwt_token = session_manager.get_effective_jwt_token(user_id, request.state.jwt_token)
# Process document and extract content
- try:
- doc_result = await document_service.process_upload_context(upload_file, filename)
- except Exception as e:
- from utils.document_processing import DoclingNotInstalledError
-
- if isinstance(e, DoclingNotInstalledError):
- return JSONResponse(
- {"error": str(e), "detail": "Install openrag[docling] for PDF/image context or use .txt files."},
- status_code=503,
- )
- raise
-
+ doc_result = await document_service.process_upload_context(upload_file, filename)
# Send document content as user message to get proper response_id
response_text, response_id = await chat_service.upload_context_chat(
doc_result["content"],