LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
[FIX] Fix for APIError in requests (#604)
harini-venkataramanb2455973d21f
diff --git a/backend/utils/request/request.py b/backend/utils/request/request.pyindex c7006af38..be802af96 100644--- a/backend/utils/request/request.py+++ b/backend/utils/request/request.py@@ -4,7 +4,6 @@ from typing import Any, Optionalimport requests as pyrequestsfrom requests.exceptions import RequestException-from unstract.prompt_service.exceptions import APIErrorlogger = logging.getLogger(__name__)@@ -44,7 +43,7 @@ def make_http_request(return return_valexcept RequestException as e:logger.error(f"HTTP request error: {e}")- raise APIError(f"Error occured while invoking POST API Variable : {str(e)}")+ raise eexcept Exception as e:logger.error(f"An unexpected error occurred: {e}")raise ediff --git a/prompt-service/src/unstract/prompt_service/utils/request.py b/prompt-service/src/unstract/prompt_service/utils/request.pyindex be802af96..c7006af38 100644--- a/prompt-service/src/unstract/prompt_service/utils/request.py+++ b/prompt-service/src/unstract/prompt_service/utils/request.py@@ -4,6 +4,7 @@ from typing import Any, Optionalimport requests as pyrequestsfrom requests.exceptions import RequestException+from unstract.prompt_service.exceptions import APIErrorlogger = logging.getLogger(__name__)@@ -43,7 +44,7 @@ def make_http_request(return return_valexcept RequestException as e:logger.error(f"HTTP request error: {e}")- raise e+ raise APIError(f"Error occured while invoking POST API Variable : {str(e)}")except Exception as e:logger.error(f"An unexpected error occurred: {e}")raise e