Skip to content

Commit

Permalink
fix(ai): message renderer not being applied (#5979)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign authored Oct 30, 2024
1 parent aae53b3 commit 4393c78
Showing 1 changed file with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ResponseComponentsProvider,
SendMessageContextProvider,
WelcomeMessageProvider,
MessageRendererProvider,
} from './context';
import { AttachmentProvider } from './context/AttachmentContext';

Expand All @@ -41,6 +42,7 @@ export const AIConversationProvider = ({
suggestedPrompts,
variant,
welcomeMessage,
messageRenderer,
}: AIConversationProviderProps): React.JSX.Element => {
const _displayText = {
...defaultAIConversationDisplayTextEn,
Expand All @@ -51,29 +53,33 @@ export const AIConversationProvider = ({
<ControlsProvider controls={controls}>
<SuggestedPromptProvider suggestedPrompts={suggestedPrompts}>
<WelcomeMessageProvider welcomeMessage={welcomeMessage}>
<ResponseComponentsProvider responseComponents={responseComponents}>
<AttachmentProvider allowAttachments={allowAttachments}>
<ConversationDisplayTextProvider {..._displayText}>
<ConversationInputContextProvider>
<SendMessageContextProvider
handleSendMessage={handleSendMessage}
>
<AvatarsProvider avatars={avatars}>
<ActionsProvider actions={actions}>
<MessageVariantProvider variant={variant}>
<MessagesProvider messages={messages}>
<LoadingContextProvider isLoading={isLoading}>
{children}
</LoadingContextProvider>
</MessagesProvider>
</MessageVariantProvider>
</ActionsProvider>
</AvatarsProvider>
</SendMessageContextProvider>
</ConversationInputContextProvider>
</ConversationDisplayTextProvider>
</AttachmentProvider>
</ResponseComponentsProvider>
<MessageRendererProvider {...messageRenderer}>
<ResponseComponentsProvider
responseComponents={responseComponents}
>
<AttachmentProvider allowAttachments={allowAttachments}>
<ConversationDisplayTextProvider {..._displayText}>
<ConversationInputContextProvider>
<SendMessageContextProvider
handleSendMessage={handleSendMessage}
>
<AvatarsProvider avatars={avatars}>
<ActionsProvider actions={actions}>
<MessageVariantProvider variant={variant}>
<MessagesProvider messages={messages}>
<LoadingContextProvider isLoading={isLoading}>
{children}
</LoadingContextProvider>
</MessagesProvider>
</MessageVariantProvider>
</ActionsProvider>
</AvatarsProvider>
</SendMessageContextProvider>
</ConversationInputContextProvider>
</ConversationDisplayTextProvider>
</AttachmentProvider>
</ResponseComponentsProvider>
</MessageRendererProvider>
</WelcomeMessageProvider>
</SuggestedPromptProvider>
</ControlsProvider>
Expand Down

0 comments on commit 4393c78

Please sign in to comment.