Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Prompt studio: Removed highlight support for enforce type JSON #1056

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
: "Highlight not supported for enforce type JSON"
jagadeeswaran-zipstack marked this conversation as resolved.
Show resolved Hide resolved
}
>
<Col
key={profileId}
Expand Down
Loading