File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
packages/compass-assistant/src Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,13 @@ describe('AssistantChat', function () {
6363 expect ( inputField . value ) . to . equal ( 'What is MongoDB?' ) ;
6464 } ) ;
6565
66+ it ( 'displays the disclaimer text' , function ( ) {
67+ renderWithChat ( [ ] ) ;
68+ expect ( screen . getByText ( / T h i s f e a t u r e i s p o w e r e d b y g e n e r a t i v e A I / ) ) . to
69+ . exist ;
70+ expect ( screen . getByText ( / P l e a s e r e v i e w t h e o u t p u t s c a r e f u l l y / ) ) . to . exist ;
71+ } ) ;
72+
6673 it ( 'send button is disabled when input is empty' , function ( ) {
6774 renderWithChat ( [ ] ) ;
6875
Original file line number Diff line number Diff line change @@ -16,16 +16,21 @@ import {
1616 fontFamilies ,
1717 palette ,
1818 useDarkMode ,
19+ LgChatChatDisclaimer ,
20+ Link ,
1921} from '@mongodb-js/compass-components' ;
2022import { useTelemetry } from '@mongodb-js/compass-telemetry/provider' ;
2123
24+ const { DisclaimerText } = LgChatChatDisclaimer ;
2225const { ChatWindow } = LgChatChatWindow ;
2326const { LeafyGreenChatProvider, Variant } = LgChatLeafygreenChatProvider ;
2427const { Message } = LgChatMessage ;
2528const { MessageFeed } = LgChatMessageFeed ;
2629const { MessageActions } = LgChatMessageActions ;
2730const { InputBar } = LgChatInputBar ;
2831
32+ const GEN_AI_FAQ_LINK = 'https://www.mongodb.com/docs/generative-ai-faq/' ;
33+
2934interface AssistantChatProps {
3035 chat : Chat < AssistantMessage > ;
3136}
@@ -191,6 +196,17 @@ export const AssistantChat: React.FunctionComponent<AssistantChatProps> = ({
191196 data-testid = "assistant-chat-messages"
192197 className = { messageFeedFixesStyles }
193198 >
199+ < DisclaimerText >
200+ This feature is powered by generative AI. See our{ ' ' }
201+ < Link
202+ hideExternalIcon = { false }
203+ href = { GEN_AI_FAQ_LINK }
204+ target = "_blank"
205+ >
206+ FAQ
207+ </ Link > { ' ' }
208+ for more information. Please review the outputs carefully.
209+ </ DisclaimerText >
194210 { lgMessages . map ( ( messageFields ) => (
195211 < Message
196212 key = { messageFields . id }
You can’t perform that action at this time.
0 commit comments