Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Fix/prompt studio bug fixes UI (#180)

Tahier Hussain8c6884722b14
diff --git a/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx b/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx
index 6d755d164..9d896340c 100644
--- a/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx
+++ b/frontend/src/components/custom-tools/document-manager/DocumentManager.jsx
@@ -15,8 +15,6 @@ import { useSessionStore } from "../../../store/session-store";
import { base64toBlob, docIndexStatus } from "../../../helpers/GetStaticData";
import { DocumentViewer } from "../document-viewer/DocumentViewer";
import { TextViewerPre } from "../text-viewer-pre/TextViewerPre";
-import { useAlertStore } from "../../../store/alert-store";
-import { useExceptionHandler } from "../../../hooks/useExceptionHandler";
const items = [
{
@@ -73,8 +71,6 @@ function DocumentManager({ generateIndex, handleUpdateTool, handleDocChange }) {
} = useCustomToolStore();
const { sessionDetails } = useSessionStore();
const axiosPrivate = useAxiosPrivate();
- const { setAlertDetails } = useAlertStore();
- const handleException = useExceptionHandler();
useEffect(() => {
setFileUrl("");
@@ -150,7 +146,6 @@ function DocumentManager({ generateIndex, handleUpdateTool, handleDocChange }) {
}
})
.catch((err) => {
- setAlertDetails(handleException(err, "Failed to fetch"));
if (err?.response?.status === 404) {
setErrorMessage(viewType);
}
diff --git a/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx b/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx
index 3c5bc9c85..b1df2cfaa 100644
--- a/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx
+++ b/frontend/src/components/custom-tools/manage-docs-modal/ManageDocsModal.jsx
@@ -129,12 +129,20 @@ function ManageDocsModal({
}, [defaultLlmProfile, details]);
useEffect(() => {
+ if (!open) {
+ return;
+ }
+
handleGetIndexStatus(rawLlmProfile, indexTypes.raw);
- }, [indexDocs, rawLlmProfile]);
+ }, [indexDocs, rawLlmProfile, open]);
useEffect(() => {
+ if (!open) {
+ return;
+ }
+
handleGetIndexStatus(summarizeLlmProfile, indexTypes.summarize);
- }, [indexDocs, summarizeLlmProfile]);
+ }, [indexDocs, summarizeLlmProfile, open]);
useEffect(() => {
// Reverse the array to have the latest logs at the beginning
diff --git a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx
index dced14415..f4a7b9f33 100644
--- a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx
+++ b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx
@@ -157,6 +157,7 @@ function PromptCard({
return;
}
+ resetInfoMsgs();
handleGetOutput();
handleGetCoverage();
}, [
@@ -249,6 +250,11 @@ function PromptCard({
setPage(index + 1);
}, [llmProfiles]);
+ const resetInfoMsgs = () => {
+ setTokenCount({}); // Reset Token Count
+ setProgressMsg({}); // Reset Progress Message
+ };
+
const handlePageLeft = () => {
if (page <= 1) {
return;
@@ -322,6 +328,7 @@ function PromptCard({
setCoverage(0);
setCoverageTotal(0);
setDocOutputs({});
+ resetInfoMsgs();
const docId = selectedDoc?.document_id;
const isSummaryIndexed = [...summarizeIndexStatus].find(
diff --git a/prompt-service/src/unstract/prompt_service/main.py b/prompt-service/src/unstract/prompt_service/main.py
index df89e18cc..214b46832 100644
--- a/prompt-service/src/unstract/prompt_service/main.py
+++ b/prompt-service/src/unstract/prompt_service/main.py
@@ -630,7 +630,7 @@ def prompt_processor() -> Any:
RunLevel.RUN,
"Execution complete",
)
- structured_output[f"{name}__usage"] = usage
+ app.logger.info("Usage details : %s", str(usage))
return structured_output