diff --git a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx index 2a8fbb4cf..2a025e86c 100644 --- a/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx +++ b/apps/nextjs/src/components/AppComponents/Chat/chat-message/index.tsx @@ -13,6 +13,7 @@ import { PromptDocument, StateDocument, TextDocument, + UnknownDocument, parseMessageParts, } from "@oakai/aila/src/protocol/jsonPatchProtocol"; import { isSafe } from "@oakai/core/src/utils/ailaModeration/helpers"; @@ -234,10 +235,14 @@ function ChatMessagePart({ action: ActionMessagePart, moderation: ModerationMessagePart, id: IdMessagePart, - }[part.document.type]; + unknown: UnknownMessagePart, + }[part.document.type] as React.ComponentType<{ + part: typeof part.document; + moderationModalHelpers: ModerationModalHelpers; + }>; if (!PartComponent) { - console.log("Unknown part type", part.document.type, part); // eslint-disable-line no-console + console.log("Unknown part type", part.document.type, JSON.stringify(part)); // eslint-disable-line no-console return null; } @@ -311,6 +316,11 @@ function ActionMessagePart({ return null; } +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function UnknownMessagePart({ part }: Readonly<{ part: UnknownDocument }>) { + return null; +} + function PartInspector({ part }: Readonly<{ part: MessagePart }>) { return (