Skip to content

Commit

Permalink
Add warning message near chat window about model hallucinations (#2794)
Browse files Browse the repository at this point in the history
Referencing issue #2756
  • Loading branch information
Quarks-1 authored Apr 25, 2023
1 parent dcf5456 commit 358a09a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/src/components/Chat/ChatListBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import useSWR from "swr";
import { ChatListItem } from "./ChatListItem";
import { CreateChatButton } from "./CreateChatButton";
import { InferencePoweredBy } from "./InferencePoweredBy";
import { ChatWarning } from "./ChatWarning";

export const ChatListBase = memo(function ChatListBase({
chats, // TODO: can we remove this?
Expand Down Expand Up @@ -84,6 +85,7 @@ export const ChatListBase = memo(function ChatListBase({
<ChatListItem key={chat.id} chat={chat} onUpdateTitle={handleUpdateTitle} onHide={handleHide}></ChatListItem>
))}
</SimpleBar>
<ChatWarning />
<InferencePoweredBy />
</Box>
);
Expand Down
27 changes: 27 additions & 0 deletions website/src/components/Chat/ChatWarning.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Flex } from "@chakra-ui/react";
import { Fragment } from "react";
import { TeamMember } from "src/components/TeamMember";

import data from "../../data/warning.json";

const warn = ["warning"] as const;

const rootProps = {
bg: "transparent",
borderRadius: 0,
};

export const ChatWarning = () => {
return (
<Flex direction="column" justifyContent="center" borderTopWidth="1px" p="2">
{warn.map((id) => (
<Fragment key={id}>
<TeamMember {...data.panels[id]} rootProps={rootProps}></TeamMember>
</Fragment>
))}
<Flex justifyContent="center" pb="2" fontSize="sm" color="gray.500">
Usage Warning
</Flex>
</Flex>
);
};
16 changes: 16 additions & 0 deletions website/src/data/warning.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"panels": {
"warning": {
"name": "Hallucinations",
"title": "This Assistant is a demonstration version that does not have internet access. It may generate incorrect or misleading information. It is not suitable for important use cases or for giving advice.",
"url": "https://en.wikipedia.org/wiki/Hallucination_(artificial_intelligence)",
"imageURL": "https://assets.stickpng.com/images/5a81af7d9123fa7bcc9b0793.png"
}
},
"groups": [
{
"name": "Usage notes",
"members": ["warning"]
}
]
}

0 comments on commit 358a09a

Please sign in to comment.