Skip to content

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

removed highlight warning and highlight metadata from tools settings (#593)

vishnuszipstackdd68b33a5bfd
diff --git a/frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx b/frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
index 9958f52dd..389a3cfe7 100644
--- a/frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
+++ b/frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
@@ -14,7 +14,6 @@ import {
Space,
Tooltip,
Typography,
- Modal,
} from "antd";
import PropTypes from "prop-types";
import { useEffect, useState } from "react";
@@ -321,21 +320,6 @@ function DsSettingsCard({ type, endpointDetails, message }) {
} else {
updatedData["destination"] = data;
}
-
- // Remove the below code once new highlight feature implemented
- // Show warning message to user when MRQ selected as destination to enable highlight
- if (
- type === "output" &&
- updatedData?.destination?.connection_type === "MANUALREVIEW"
- ) {
- Modal.warning({
- title: "Warning",
- content:
- "Please ensure that the tool in use is exported with Highlighting enabled.",
- });
- }
- // Warning message section.
-
updateWorkflow(updatedData);
if (showSuccess) {
setAlertDetails({
diff --git a/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.css b/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.css
deleted file mode 100644
index 31cae927c..000000000
--- a/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.highlight-metadata {
- margin-top: 16px;
-}
diff --git a/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.jsx b/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.jsx
deleted file mode 100644
index b350ac782..000000000
--- a/frontend/src/components/custom-tools/highlight-metadata/HighLightMetaData.jsx
+++ /dev/null
@@ -1,112 +0,0 @@
-import { Checkbox, Form, Space, Typography, Alert } from "antd";
-import PropTypes from "prop-types";
-import { useEffect, useState } from "react";
-
-import SpaceWrapper from "../../widgets/space-wrapper/SpaceWrapper";
-import { CustomButton } from "../../../components/widgets/custom-button/CustomButton";
-import { useCustomToolStore } from "../../../store/custom-tool-store";
-import { useAlertStore } from "../../../store/alert-store";
-import { useExceptionHandler } from "../../../hooks/useExceptionHandler";
-import "./HighLightMetaData.css";
-
-function HighLightMetaData({ handleUpdateTool }) {
- const [enableHighlighting, setEnableHighlighting] = useState(false);
- const [isLoading, setIsLoading] = useState(false);
-
- const { details, updateCustomTool, isPublicSource } = useCustomToolStore();
-
- const { setAlertDetails } = useAlertStore();
- const handleException = useExceptionHandler();
-
- useEffect(() => {
- setEnableHighlighting(details?.enable_highlight || false);
- }, []);
-
- const handleSubmit = () => {
- const body = {
- enable_highlight: enableHighlighting,
- };
- setIsLoading(true);
- handleUpdateTool(body)
- .then((res) => {
- const data = res?.data;
- const updatedDetails = { ...details };
-
- updatedDetails["enable_highlight"] = data?.enable_challenge;
- updateCustomTool({ details: updatedDetails });
-
- setAlertDetails({
- type: "success",
- content: "Saved highlight settings successfully",
- });
- })
- .catch((err) => {
- setAlertDetails(handleException(err, "Failed to update"));
- })
- .finally(() => {
- setIsLoading(false);
- });
- };
-
- return (
- <SpaceWrapper>
- <div className="settings-body-pad-top">
- <Typography.Text strong className="pre-post-amble-title">
- Enable highlighting ( Will only work with LLM whisperer as text
- extractor)
- </Typography.Text>
- </div>
- <Form layout="vertical" onFinish={handleSubmit}>
- <Form.Item>
- <Space>
- <Checkbox
- checked={enableHighlighting}
- onChange={(e) => setEnableHighlighting(e.target.checked)}
- disabled={isPublicSource}
- />
- <Typography.Text>Enable Highlighting</Typography.Text>
- </Space>
- <Space>
- <Alert
- className="highlight-metadata"
- message={
- <>
- Turn this option on if downstream use cases need you to
- highlight extracted portions in the source document. e.g: for
- manual review. This option instructs LLMWhisperer to store
- highlighting information, which can be extracted using the
- returned Whisper Hash. Please see the{" "}
- <a
- href="https://docs.unstract.com/llm_whisperer/apis/llm_whisperer_text_extraction_highlight_api"
- target="_blank"
- rel="noopener noreferrer"
- >
- Highlighting API documentation
- </a>{" "}
- for more details.
- </>
- }
- type="info"
- />
- </Space>
- </Form.Item>
- <Form.Item className="display-flex-right">
- <CustomButton
- type="primary"
- htmlType="submit"
- loading={isLoading}
- disabled={isPublicSource}
- >
- Save
- </CustomButton>
- </Form.Item>
- </Form>
- </SpaceWrapper>
- );
-}
-
-HighLightMetaData.propTypes = {
- handleUpdateTool: PropTypes.func.isRequired,
-};
-
-export { HighLightMetaData };
diff --git a/frontend/src/components/custom-tools/settings-modal/SettingsModal.jsx b/frontend/src/components/custom-tools/settings-modal/SettingsModal.jsx
index 023e14c2e..c46f2163a 100644
--- a/frontend/src/components/custom-tools/settings-modal/SettingsModal.jsx
+++ b/frontend/src/components/custom-tools/settings-modal/SettingsModal.jsx
@@ -14,7 +14,6 @@ import { ManageLlmProfiles } from "../manage-llm-profiles/ManageLlmProfiles";
import { useCustomToolStore } from "../../../store/custom-tool-store";
import { CustomSynonyms } from "../custom-synonyms/CustomSynonyms";
import { PreAndPostAmbleModal } from "../pre-and-post-amble-modal/PreAndPostAmbleModal";
-import { HighLightMetaData } from "../highlight-metadata/HighLightMetaData.jsx";
import "./SettingsModal.css";
@@ -42,7 +41,6 @@ function SettingsModal({ open, setOpen, handleUpdateTool }) {
getMenuItem("Manage Grammar", 5, <MessageOutlined />),
getMenuItem("Preamble", 6, <DiffOutlined />),
getMenuItem("Postamble", 7, <DiffOutlined />),
- getMenuItem("Manage Highlighting", 8, <CodeOutlined />),
];
const listOfComponents = {
@@ -60,7 +58,6 @@ function SettingsModal({ open, setOpen, handleUpdateTool }) {
handleUpdateTool={handleUpdateTool}
/>
),
- 8: <HighLightMetaData handleUpdateTool={handleUpdateTool} />,
};
let position = 1;