LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
feat: Minor index error handling enhancement (#294)
Chandrasekharan M2b1afa82d6ce
diff --git a/backend/prompt_studio/prompt_studio_core/exceptions.py b/backend/prompt_studio/prompt_studio_core/exceptions.pyindex 9f4d2b73b..8e03342b0 100644--- a/backend/prompt_studio/prompt_studio_core/exceptions.py+++ b/backend/prompt_studio/prompt_studio_core/exceptions.py@@ -19,7 +19,7 @@ class PromptNotValid(APIException):class IndexingAPIError(APIException):- status_code = 400+ status_code = 500default_detail = "Error while indexing file"diff --git a/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py b/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.pyindex 154600369..21e1e3eb3 100644--- a/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py+++ b/backend/prompt_studio/prompt_studio_core/prompt_studio_helper.py@@ -661,13 +661,14 @@ class PromptStudioHelper:)return doc_idexcept IndexingError as e:+ doc_name = os.path.split(file_path)[1]PromptStudioHelper._publish_log(- {"tool_id": tool_id, "doc_name": os.path.split(file_path)[1]},+ {"tool_id": tool_id, "doc_name": doc_name},LogLevels.ERROR,LogLevels.RUN,- "Indexing failed",+ f"Indexing failed : {e}",)- raise IndexingAPIError(str(e)) from e+ raise IndexingAPIError(f"Error while indexing {doc_name}. {str(e)}") from e@staticmethoddef _fetch_single_pass_response(diff --git a/backend/sample.env b/backend/sample.envindex f4fc27d7c..e81d824fb 100644--- a/backend/sample.env+++ b/backend/sample.env@@ -123,8 +123,10 @@ SYSTEM_ADMIN_EMAIL="[email protected]"# Set Django Session Expiry Time (in seconds)SESSION_COOKIE_AGE=86400+# Control async extraction of LLM Whisperer# Time in seconds to wait before polling LLMWhisperer's status APIADAPTER_LLMW_POLL_INTERVAL=30# Total number of times to poll the status API.-ADAPTER_LLMW_MAX_POLLS=30+# 500 mins to allow 1500 (max pages limit) * 20 (approx time in sec to process a page)+ADAPTER_LLMW_MAX_POLLS=1000