Skip to content

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

Bug Fixes - LLM edit, Combined Output and Default LLM Profile Selection (#46)

Tahier Hussain2ddc1c04e7b4
diff --git a/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx b/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
index addf4b11c..3e60a6788 100644
--- a/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
+++ b/frontend/src/components/custom-tools/add-llm-profile-modal/AddLlmProfileModal.jsx
@@ -68,7 +68,7 @@ function AddLlmProfileModal({
}, []);
useEffect(() => {
- if (!open) {
+ if (open && editLlmProfileId) {
return;
}
@@ -356,7 +356,8 @@ function AddLlmProfileModal({
<SpaceWrapper>
<div>
<Typography.Text className="add-cus-tool-header">
- Add New LLM Profile
+ {editLlmProfileId?.length > 0 ? "Update" : "Add"} New LLM
+ Profile
</Typography.Text>
</div>
<div>
diff --git a/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx b/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx
index 5340b4bfa..9cc026c45 100644
--- a/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx
+++ b/frontend/src/components/custom-tools/combined-output/CombinedOutput.jsx
@@ -64,7 +64,11 @@ function CombinedOutput({ doc, setFilledFields }) {
return;
}
- output[item?.prompt_key] = JSON.parse(outputDetails?.output || "");
+ try {
+ output[item?.prompt_key] = JSON.parse(outputDetails?.output);
+ } catch (err) {
+ output[item?.prompt_key] = outputDetails?.output || "";
+ }
if (outputDetails?.output?.length > 0) {
filledFields++;
diff --git a/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx b/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
index 110e3eb21..b538986ab 100644
--- a/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
+++ b/frontend/src/components/custom-tools/manage-llm-profiles/ManageLlmProfiles.jsx
@@ -164,6 +164,12 @@ function ManageLlmProfiles({ setOpen, setOpenLlm, setEditLlmProfileId }) {
const body = {
llmProfiles: modifiedLlmProfiles,
};
+
+ // Reset the default LLM profile if it got deleted.
+ if (id === defaultLlmProfile) {
+ body["defaultLlmProfile"] = "";
+ }
+
updateCustomTool(body);
})
.catch((err) => {
diff --git a/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx b/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx
index bc9a22347..0f231fe02 100644
--- a/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx
+++ b/frontend/src/components/custom-tools/tool-ide/ToolIde.jsx
@@ -147,20 +147,13 @@ function ToolIde() {
output: docName,
};
- handleUpdateTool(body)
- .then(() => {
- setAlertDetails({
- type: "success",
- content: "Document changed successfully",
- });
- })
- .catch((err) => {
- const revertSelectedDoc = {
- selectedDoc: prevSelectedDoc,
- };
- updateCustomTool(revertSelectedDoc);
- setAlertDetails(handleException(err, "Failed to select the document"));
- });
+ handleUpdateTool(body).catch((err) => {
+ const revertSelectedDoc = {
+ selectedDoc: prevSelectedDoc,
+ };
+ updateCustomTool(revertSelectedDoc);
+ setAlertDetails(handleException(err, "Failed to select the document"));
+ });
};
return (