Skip to content

Commit

Permalink
refactor: show why this answer from integration config, defaults to true
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed May 7, 2024
1 parent d3767e2 commit 41e7369
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface Props {
showDates?: boolean;
showContextPerLine?: boolean;
showAIicon?: boolean;
showWhyThisAnswer?: boolean;
client: ReturnType<typeof memoriApiClient>;
selectReceiverTag: (tag: string) => Promise<void>;
preview?: boolean;
Expand Down Expand Up @@ -84,6 +85,7 @@ const Chat: React.FC<Props> = ({
showDates = false,
showContextPerLine = false,
showAIicon = true,
showWhyThisAnswer = true,
selectReceiverTag,
preview = false,
instruct = false,
Expand Down Expand Up @@ -205,6 +207,7 @@ const Chat: React.FC<Props> = ({
sessionID={sessionID}
simulateUserPrompt={simulateUserPrompt}
showAIicon={showAIicon}
showWhyThisAnswer={showWhyThisAnswer}
showFeedback={
index === history.length - 1 &&
!message.fromUser &&
Expand Down
6 changes: 6 additions & 0 deletions src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,11 @@ const MemoriWidget = ({
? true
: integrationConfig?.showAIicon;

const showWhyThisAnswer =
integrationConfig?.showWhyThisAnswer === undefined
? true
: integrationConfig?.showWhyThisAnswer;

// eslint-disable-next-line
const [avatar3dVisible, setAvatar3dVisible] = useState(false);
useEffect(() => {
Expand Down Expand Up @@ -2933,6 +2938,7 @@ const MemoriWidget = ({
showDates,
showContextPerLine,
showAIicon,
showWhyThisAnswer,
client,
selectReceiverTag,
preview,
Expand Down

0 comments on commit 41e7369

Please sign in to comment.