LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
Prompt studio fixes (#503)
jagadeeswaran-zipstackd2ea64071733
diff --git a/backend/prompt_studio/prompt_studio_output_manager/output_manager_helper.py b/backend/prompt_studio/prompt_studio_output_manager/output_manager_helper.pyindex b88a25602..6d97cf633 100644--- a/backend/prompt_studio/prompt_studio_output_manager/output_manager_helper.py+++ b/backend/prompt_studio/prompt_studio_output_manager/output_manager_helper.py@@ -101,7 +101,7 @@ class OutputManagerHelper:document_manager = DocumentManager.objects.get(pk=document_id)for prompt in prompts:- if prompt.prompt_type == PSOMKeys.NOTES or not prompt.active:+ if prompt.prompt_type == PSOMKeys.NOTES:continueif not is_single_pass_extract:diff --git a/backend/prompt_studio/prompt_studio_registry/exceptions.py b/backend/prompt_studio/prompt_studio_registry/exceptions.pyindex 12a182991..93086d815 100644--- a/backend/prompt_studio/prompt_studio_registry/exceptions.py+++ b/backend/prompt_studio/prompt_studio_registry/exceptions.py@@ -19,8 +19,9 @@ class ToolSaveError(APIException):class EmptyToolExportError(APIException):status_code = 500default_detail = (- "Empty Prompt Studio project without prompts cannot be exported. "- "Try adding a prompt and executing it."+ "Prompt Studio project without prompts cannot be exported. "+ "Please ensure there is at least one prompt and "+ "it is active before exporting.")diff --git a/backend/prompt_studio/prompt_studio_registry/prompt_studio_registry_helper.py b/backend/prompt_studio/prompt_studio_registry/prompt_studio_registry_helper.pyindex 33c253205..8a9877a85 100644--- a/backend/prompt_studio/prompt_studio_registry/prompt_studio_registry_helper.py+++ b/backend/prompt_studio/prompt_studio_registry/prompt_studio_registry_helper.py@@ -325,6 +325,9 @@ class PromptStudioRegistryHelper:llm = ""embedding_model = ""+ if not outputs:+ raise EmptyToolExportError()+if invalidated_prompts:raise InValidCustomToolError(f"Cannot export tool. Prompt(s): {', '.join(invalidated_prompts)} "diff --git a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsxindex c945faec7..883433f3d 100644--- a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx+++ b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx@@ -481,13 +481,7 @@ function PromptCard({.then((res) => {const data = res?.data?.output;const outputValue = data[promptDetails?.prompt_key];- if (outputValue || outputValue === 0) {- updateDocCoverage(- promptDetails?.prompt_id,- profileManagerId,- docId- );- }+ updateDocCoverage(promptDetails?.prompt_id, profileManagerId, docId);handleDocOutputs(docId,promptDetails?.prompt_id,diff --git a/prompt-service/src/unstract/prompt_service/main.py b/prompt-service/src/unstract/prompt_service/main.pyindex 73787685d..aeb9f022c 100644--- a/prompt-service/src/unstract/prompt_service/main.py+++ b/prompt-service/src/unstract/prompt_service/main.py@@ -204,28 +204,12 @@ def prompt_processor() -> Any:for output in outputs: # type:ignorevariable_names.append(output[PSKeys.NAME])for output in outputs: # type:ignore- is_active = output[PSKeys.ACTIVE]prompt_name = output[PSKeys.NAME]promptx = output[PSKeys.PROMPT]chunk_size = output[PSKeys.CHUNK_SIZE]util = PromptServiceBaseTool(log_level=LogLevel.INFO, platform_key=platform_key)index = Index(tool=util)- if is_active is False:- app.logger.info(f"[{tool_id}] Skipping inactive prompt: {prompt_name}")- _publish_log(- log_events_id,- {- "tool_id": tool_id,- "prompt_key": prompt_name,- "doc_name": doc_name,- },- LogLevel.INFO,- RunLevel.RUN,- "Skipping inactive prompt",- )- continue-app.logger.info(f"[{tool_id}] Executing prompt: {prompt_name}")_publish_log(log_events_id,