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: Prompt Studio Improvements and Bug Fixes (#223)
Tahier Hussain9ac96a4fa2bb
diff --git a/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx b/frontend/src/components/custom-tools/document-manager/DocumentManager.jsxindex 981e4f5e8..f039b9cf0 100644--- a/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx+++ b/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx@@ -209,7 +209,9 @@ function DocumentManager({ generateIndex, handleUpdateTool, handleDocChange }) {const updatePageAndDoc = (newPage) => {setPage(newPage);const newSelectedDoc = listOfDocs[newPage - 1];- handleDocChange(newSelectedDoc?.document_id);+ if (newSelectedDoc) {+ handleDocChange(newSelectedDoc);+ }};return (diff --git a/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx b/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsxindex d0168e0e6..5293bdc49 100644--- a/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx+++ b/frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx@@ -133,7 +133,7 @@ function ListOfTools() {setListOfTools(tools);setAlertDetails({type: "success",- console: "Deleted successfully",+ content: `${tool?.tool_name} - Deleted successfully`,});}).catch((err) => {diff --git a/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx b/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsxindex b1df2cfaa..2c65029ec 100644--- a/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx+++ b/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx@@ -396,7 +396,7 @@ function ManageDocsModal({select: (<Radiochecked={selectedDoc?.document_id === item?.document_id}- onClick={() => handleDocChange(item?.document_id)}+ onClick={() => handleDocChange(item)}disabled={disableLlmOrDocChange?.length > 0 ||isSinglePassExtractLoading ||@@ -461,6 +461,13 @@ function ManageDocsModal({};updateCustomTool(body);handleUpdateTool({ output: doc?.document_id });++ if (+ newListOfDocs?.length === 1 &&+ selectedDoc?.document_id !== doc?.document_id+ ) {+ handleDocChange(doc);+ }} else if (info.file.status === "error") {setIsUploading(false);setAlertDetails({diff --git a/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx b/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsxindex 962de7c7d..439016d8e 100644--- a/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx+++ b/frontend/src/components/custom-tools/output-for-doc-modal/OutputForDocModal.jsx@@ -178,7 +178,7 @@ function OutputForDocModal({(outputValue) => outputValue?.document_manager === item?.document_id);let status = outputStatus.fail;- let message = "Failed";+ let message = displayPromptResult(output?.output, true);if (output?.output || output?.output === 0) {status = outputStatus.success;diff --git a/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx b/frontend/src/components/custom-tools/tool-ide/ToolIde.jsxindex 0e543d400..a5c87ff64 100644--- a/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx+++ b/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx@@ -26,7 +26,6 @@ function ToolIde() {updateCustomTool,disableLlmOrDocChange,selectedDoc,- listOfDocs,indexDocs,pushIndexDoc,deleteIndexDoc,@@ -134,7 +133,7 @@ function ToolIde() {});};- const handleDocChange = (docId) => {+ const handleDocChange = (doc) => {if (disableLlmOrDocChange?.length > 0) {setAlertDetails({type: "error",@@ -143,8 +142,6 @@ function ToolIde() {return;}- const doc = [...listOfDocs].find((item) => item?.document_id === docId);-const prevSelectedDoc = selectedDoc;const data = {selectedDoc: doc,@@ -152,7 +149,7 @@ function ToolIde() {updateCustomTool(data);const body = {- output: docId,+ output: doc?.document_id,};handleUpdateTool(body).catch((err) => {