From a4e30e12551993a27ab87cfcd4a8e89c7ed06c3b Mon Sep 17 00:00:00 2001 From: jagadeeswaran-zipstack Date: Wed, 8 Jan 2025 13:23:46 +0530 Subject: [PATCH 1/2] removed highlight support for json --- .../components/custom-tools/prompt-card/PromptCard.jsx | 5 ++++- .../components/custom-tools/prompt-card/PromptOutput.jsx | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx index 794a450cc..8bccb5607 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptCard.jsx @@ -171,7 +171,10 @@ const PromptCard = memo( highlightedPrompt, highlightedProfile ) => { - if (details?.enable_highlight) { + if ( + details?.enable_highlight && + promptDetailsState?.enforce_type !== "json" + ) { updateCustomTool({ selectedHighlight: { highlight: highlightData, diff --git a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx index 70580f192..3a6b16db4 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx @@ -84,7 +84,6 @@ function PromptOutput({ const { generatePromptOutputKey } = usePromptOutput(); const isTableExtraction = enforceType === TABLE_ENFORCE_TYPE || enforceType === RECORD_ENFORCE_TYPE; - const tooltipContent = (adapterConf) => (
{Object.entries(adapterConf)?.map(([key, value]) => ( @@ -205,13 +204,18 @@ function PromptOutput({ transition={{ duration: 0.5, ease: "linear" }} className={`prompt-card-llm ${ details?.enable_highlight && + enforceType !== "json" && selectedHighlight?.highlightedPrompt === promptId && selectedHighlight?.highlightedProfile === profileId && "highlighted-prompt-cell" }`} > Date: Wed, 8 Jan 2025 13:58:47 +0530 Subject: [PATCH 2/2] Update tooltip message Co-authored-by: Gayathri <142381512+gaya3-zipstack@users.noreply.github.com> Signed-off-by: jagadeeswaran-zipstack --- .../src/components/custom-tools/prompt-card/PromptOutput.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx index 3a6b16db4..e0d27c58c 100644 --- a/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx +++ b/frontend/src/components/custom-tools/prompt-card/PromptOutput.jsx @@ -214,7 +214,7 @@ function PromptOutput({ title={ details?.enable_highlight && enforceType !== "json" ? "Click to highlight" - : "Highlight not supported for enforce type JSON" + : "Highlighting is not supported when enforce type is JSON" } >