Skip to content

Commit

Permalink
Fix secondary tags use in LLM
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaKhatri committed Jan 7, 2025
1 parent 0b5fd43 commit d0a095f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/components/LeftPaneEntries/AssistItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ import {
ModelTagsType,
Matrix1dValue,
Matrix2dValue,
SingleSelectValue,
MultiSelectValue,
ScaleValue,
OrganigramValue,
} from '#types/newAnalyticalFramework';

import AssistPopup from './AssistPopup';
Expand All @@ -52,6 +56,10 @@ import {
isValidObject,
createMatrix1dAttrFromTags,
createMatrix2dAttrFromTags,
createSingleSelectAttrFromTags,
createMultiSelectAttrFromTags,
createScaleAttrFromTags,
createOrganigramAttrFromTags,
} from './utils';

import styles from './styles.css';
Expand Down Expand Up @@ -262,6 +270,30 @@ function AssistItem(props: Props) {
widget,
);
}
if (widget.widgetId === 'MULTISELECT') {
return createMultiSelectAttrFromTags(
recommendedTags[widget.key] as MultiSelectValue,
widget,
);
}
if (widget.widgetId === 'SELECT') {
return createSingleSelectAttrFromTags(
recommendedTags[widget.key] as unknown as SingleSelectValue,
widget,
);
}
if (widget.widgetId === 'SCALE') {
return createScaleAttrFromTags(
recommendedTags[widget.key] as unknown as ScaleValue,
widget,
);
}
if (widget.widgetId === 'ORGANIGRAM') {
return createOrganigramAttrFromTags(
recommendedTags[widget.key] as OrganigramValue,
widget,
);
}
return undefined;
}).filter(isDefined);

Expand Down
32 changes: 32 additions & 0 deletions app/components/LeftPaneEntries/AutoEntriesModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,21 @@ import {
ModelTagsType,
Matrix1dValue,
Matrix2dValue,
SingleSelectValue,
MultiSelectValue,
ScaleValue,
OrganigramValue,
} from '#types/newAnalyticalFramework';
import AssistPopup from '../AssistItem/AssistPopup';
import { createDefaultAttributes } from '../utils';
import {
isValidObject,
createMatrix1dAttrFromTags,
createMatrix2dAttrFromTags,
createSingleSelectAttrFromTags,
createMultiSelectAttrFromTags,
createScaleAttrFromTags,
createOrganigramAttrFromTags,
} from '../AssistItem/utils';

import styles from './styles.css';
Expand Down Expand Up @@ -393,6 +401,30 @@ function AutoEntriesModal(props: Props) {
widget,
);
}
if (widget.widgetId === 'MULTISELECT') {
return createMultiSelectAttrFromTags(
recommendedTags[widget.key] as MultiSelectValue,
widget,
);
}
if (widget.widgetId === 'SELECT') {
return createSingleSelectAttrFromTags(
recommendedTags[widget.key] as unknown as SingleSelectValue,
widget,
);
}
if (widget.widgetId === 'SCALE') {
return createScaleAttrFromTags(
recommendedTags[widget.key] as unknown as ScaleValue,
widget,
);
}
if (widget.widgetId === 'ORGANIGRAM') {
return createOrganigramAttrFromTags(
recommendedTags[widget.key] as OrganigramValue,
widget,
);
}
return undefined;
}).filter(isDefined);

Expand Down

0 comments on commit d0a095f

Please sign in to comment.