Skip to content

Commit

Permalink
[Fix] Prompt studio: Removed highlight support for enforce type JSON (#…
Browse files Browse the repository at this point in the history
…1056)

* removed highlight support for json

* Update tooltip message

Co-authored-by: Gayathri <[email protected]>
Signed-off-by: jagadeeswaran-zipstack <[email protected]>

---------

Signed-off-by: jagadeeswaran-zipstack <[email protected]>
Co-authored-by: Gayathri <[email protected]>
  • Loading branch information
jagadeeswaran-zipstack and gaya3-zipstack authored Jan 8, 2025
1 parent ab24e7b commit 91e4c6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function PromptOutput({
const { generatePromptOutputKey } = usePromptOutput();
const isTableExtraction =
enforceType === TABLE_ENFORCE_TYPE || enforceType === RECORD_ENFORCE_TYPE;

const tooltipContent = (adapterConf) => (
<div>
{Object.entries(adapterConf)?.map(([key, value]) => (
Expand Down Expand Up @@ -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"
}`}
>
<Tooltip
title={details?.enable_highlight && "Click to highlight"}
title={
details?.enable_highlight && enforceType !== "json"
? "Click to highlight"
: "Highlighting is not supported when enforce type is JSON"
}
>
<Col
key={profileId}
Expand Down

0 comments on commit 91e4c6c

Please sign in to comment.